Class: Operations::FeatureFlags::UserList

Inherits:
ApplicationRecord show all
Includes:
AtomicInternalId, Gitlab::SQL::Pattern, IidRoutes
Defined in:
app/models/operations/feature_flags/user_list.rb

Constant Summary

Constants included from Gitlab::SQL::Pattern

Gitlab::SQL::Pattern::MIN_CHARS_FOR_PARTIAL_MATCHING, Gitlab::SQL::Pattern::REGEX_QUOTED_TERM

Constants included from AtomicInternalId

AtomicInternalId::MissingValueError

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Class Method Summary collapse

Methods included from Gitlab::SQL::Pattern

split_query_to_search_terms

Methods included from IidRoutes

#to_param

Methods included from AtomicInternalId

group_init, #internal_id_read_scope, #internal_id_scope_attrs, #internal_id_scope_usage, namespace_init, project_init, scope_attrs, scope_usage

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Class Method Details

.belongs_to?(project_id, user_list_ids) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
# File 'app/models/operations/feature_flags/user_list.rb', line 31

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