diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 16:47:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 16:47:02 +0000 |
commit | d00f14d73f41129f9d986d4bec32f1f927b525a6 (patch) | |
tree | 93a8f2296ead9161cd71899e4f410e929ae33fb4 /app/models | |
parent | 1b6a590b197788a06a1ff726ea61630a49b10412 (diff) | |
download | gitlab-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.rb | 5 |
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 |