Class: Analytics::CycleAnalytics::ProjectStage

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Stage
Defined in:
app/models/analytics/cycle_analytics/project_stage.rb

Constant Summary

Constants included from Gitlab::RelativePositioning

Gitlab::RelativePositioning::IDEAL_DISTANCE, Gitlab::RelativePositioning::IllegalRange, Gitlab::RelativePositioning::InvalidPosition, Gitlab::RelativePositioning::IssuePositioningDisabled, Gitlab::RelativePositioning::MAX_GAP, Gitlab::RelativePositioning::MAX_POSITION, Gitlab::RelativePositioning::MIN_GAP, Gitlab::RelativePositioning::MIN_POSITION, Gitlab::RelativePositioning::NoSpaceLeft, Gitlab::RelativePositioning::START_POSITION, Gitlab::RelativePositioning::STEPS

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Class Method Summary collapse

Methods included from Stage

#default_stage?, #end_event, #end_event_identifier=, #end_event_label_based?, #events_hash_code, #find_with_same_parent!, #matches_with_stage_params?, #params_for_end_event, #params_for_start_event, #parent, #parent=, #start_event, #start_event_identifier=, #start_event_label_based?, #subject_class

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from RelativePositioning

#check_repositioning_allowed!, #could_not_move, #exclude_self, #model_class, #move_after, #move_before, #move_between, #move_to_end, #move_to_start, mover, #next_object_by_relative_position, #relative_positioning_scoped_items, #reset_relative_position, #update_relative_siblings

Methods included from Gitlab::RelativePositioning

range

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

.distinct_stages_within_hierarchy(group) ⇒ Object


29
30
31
32
33
# File 'app/models/analytics/cycle_analytics/project_stage.rb', line 29

def self.distinct_stages_within_hierarchy(group)
  with_preloaded_labels
    .where(project_id: group.all_projects.select(:id))
    .select("DISTINCT ON(stage_event_hash_id) #{quoted_table_name}.*")
end

.relative_positioning_parent_columnObject


25
26
27
# File 'app/models/analytics/cycle_analytics/project_stage.rb', line 25

def self.relative_positioning_parent_column
  :project_id
end

.relative_positioning_query_base(stage) ⇒ Object


21
22
23
# File 'app/models/analytics/cycle_analytics/project_stage.rb', line 21

def self.relative_positioning_query_base(stage)
  where(project_id: stage.project_id)
end