Class: Gitlab::BackgroundMigration::BackfillSecurityProjectTrackedContextsDefaultBranch::Project
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Gitlab::BackgroundMigration::BackfillSecurityProjectTrackedContextsDefaultBranch::Project
- Includes:
- Routable
- Defined in:
- lib/gitlab/background_migration/backfill_security_project_tracked_contexts_default_branch.rb
Constant Summary
Constants inherited from ApplicationRecord
Constants included from HasCheckConstraints
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
Constants included from ResetOnColumnErrors
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Method Summary collapse
- #create_repository(default_branch) ⇒ Object
- #default_branch ⇒ Object
- #default_branch_or_main ⇒ Object
- #repository ⇒ Object
Methods included from Routable
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
Methods included from ResetOnColumnErrors
#reset_on_union_error, #reset_on_unknown_attribute_error
Methods included from SensitiveSerializableHash
Instance Method Details
#create_repository(default_branch) ⇒ Object
208 209 210 |
# File 'lib/gitlab/background_migration/backfill_security_project_tracked_contexts_default_branch.rb', line 208 def create_repository(default_branch) repository.create_repository(default_branch) end |
#default_branch ⇒ Object
198 199 200 |
# File 'lib/gitlab/background_migration/backfill_security_project_tracked_contexts_default_branch.rb', line 198 def default_branch @default_branch ||= repository.root_ref end |
#default_branch_or_main ⇒ Object
202 203 204 205 206 |
# File 'lib/gitlab/background_migration/backfill_security_project_tracked_contexts_default_branch.rb', line 202 def default_branch_or_main return default_branch if default_branch 'main' end |
#repository ⇒ Object
212 213 214 |
# File 'lib/gitlab/background_migration/backfill_security_project_tracked_contexts_default_branch.rb', line 212 def repository @repository ||= Repository.new(full_path, self, shard: repository_storage, disk_path: storage.disk_path) end |