Module: Gitlab::BackgroundMigration::BackfillProjectRepositories::Routable

Extended by:
ActiveSupport::Concern
Included in:
Namespace, Project
Defined in:
lib/gitlab/background_migration/backfill_project_repositories.rb

Overview

Concern used by Project and Namespace to determine the full route to the project

Instance Method Summary collapse

Instance Method Details

#build_full_pathObject


89
90
91
92
93
94
95
# File 'lib/gitlab/background_migration/backfill_project_repositories.rb', line 89

def build_full_path
  return path unless has_parent?

  raise OrphanedNamespaceError if parent.nil?

  parent.full_path + '/' + path
end

#full_pathObject


85
86
87
# File 'lib/gitlab/background_migration/backfill_project_repositories.rb', line 85

def full_path
  route&.path || build_full_path
end

#has_parent?Boolean

Returns:

  • (Boolean)

97
98
99
# File 'lib/gitlab/background_migration/backfill_project_repositories.rb', line 97

def has_parent?
  read_attribute(association(:parent).reflection.foreign_key)
end