Class: Ci::ProjectMirror

Inherits:
ApplicationRecord show all
Includes:
FromUnion
Defined in:
app/models/ci/project_mirror.rb

Overview

This model represents a shadow table of the main database’s projects table. It allows us to navigate the project and namespace hierarchy on the ci database.

Constant Summary

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Class Method Summary collapse

Methods inherited from ApplicationRecord

model_name, table_name_prefix

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

.sync!(event) ⇒ Object



15
16
17
# File 'app/models/ci/project_mirror.rb', line 15

def sync!(event)
  upsert({ project_id: event.project_id, namespace_id: event.project.namespace_id }, unique_by: :project_id)
end