Class: ExperimentSubject

Inherits:
ApplicationRecord show all
Includes:
Gitlab::Experimentation::GroupTypes
Defined in:
app/models/experiment_subject.rb

Constant Summary

Constants included from Gitlab::Experimentation::GroupTypes

Gitlab::Experimentation::GroupTypes::GROUP_CONTROL, Gitlab::Experimentation::GroupTypes::GROUP_EXPERIMENTAL

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Class Method Summary collapse

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

.valid_subject?(subject) ⇒ Boolean

Returns:

  • (Boolean)

17
18
19
# File 'app/models/experiment_subject.rb', line 17

def self.valid_subject?(subject)
  subject.is_a?(Namespace) || subject.is_a?(User) || subject.is_a?(Project)
end