Class: Analytics::CycleAnalytics::ValueStream

Inherits:
ApplicationRecord show all
Includes:
Parentable
Defined in:
app/models/analytics/cycle_analytics/value_stream.rb

Constant Summary collapse

MAX_VALUE_STREAMS_PER_NAMESPACE =
50

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from HasCheckConstraints

HasCheckConstraints::NOT_NULL_CHECK_PATTERN

Constants included from ResetOnColumnErrors

ResetOnColumnErrors::MAX_RESET_PERIOD

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, 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 Organizations::Sharding

#sharding_organization

Methods included from ResetOnColumnErrors

#reset_on_union_error, #reset_on_unknown_attribute_error

Methods included from Gitlab::SensitiveSerializableHash

#serializable_hash

Class Method Details

.build_default_value_stream(namespace) ⇒ Object



35
36
37
# File 'app/models/analytics/cycle_analytics/value_stream.rb', line 35

def self.build_default_value_stream(namespace)
  new(name: Analytics::CycleAnalytics::Stages::BaseService::DEFAULT_VALUE_STREAM_NAME, namespace: namespace)
end

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/analytics/cycle_analytics/value_stream.rb', line 31

def custom?
  persisted? || name != Analytics::CycleAnalytics::Stages::BaseService::DEFAULT_VALUE_STREAM_NAME
end

#projectObject



39
40
41
42
43
# File 'app/models/analytics/cycle_analytics/value_stream.rb', line 39

def project
  return unless namespace.is_a?(::Namespaces::ProjectNamespace)

  namespace.project
end

#to_global_idObject



45
46
47
48
49
50
# File 'app/models/analytics/cycle_analytics/value_stream.rb', line 45

def to_global_id
  return super if persisted?

  # Returns default name as id for built in value stream at FOSS level
  name
end