diff options
Diffstat (limited to 'app/models/operations/feature_flags/user_list.rb')
-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 |