summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-04 16:47:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-04 16:47:02 +0000
commitd00f14d73f41129f9d986d4bec32f1f927b525a6 (patch)
tree93a8f2296ead9161cd71899e4f410e929ae33fb4 /app/models
parent1b6a590b197788a06a1ff726ea61630a49b10412 (diff)
downloadgitlab-ce-d00f14d73f41129f9d986d4bec32f1f927b525a6.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-6-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r--app/models/operations/feature_flags/user_list.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/operations/feature_flags/user_list.rb b/app/models/operations/feature_flags/user_list.rb
index 3e492eaa892..ec109bde0eb 100644
--- a/app/models/operations/feature_flags/user_list.rb
+++ b/app/models/operations/feature_flags/user_list.rb
@@ -28,6 +28,11 @@ module Operations
fuzzy_search(query, [:name], use_minimum_char_limit: false)
end
+ def self.belongs_to?(project_id, user_list_ids)
+ uniq_ids = user_list_ids.uniq
+ where(id: uniq_ids, project_id: project_id).count == uniq_ids.count
+ end
+
private
def ensure_no_associated_strategies