Class: Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::Project

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Routable
Defined in:
lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb

Constant Summary collapse

HASHED_STORAGE_FEATURES =
{
  repository: 1,
  attachments: 2
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Routable

#build_full_path, #full_path, #prepare_route, #update_route

Class Method Details

.nameObject

Overridden to have the correct `source_type` for the `route` relation


84
85
86
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 84

def self.name
  'Project'
end

Instance Method Details

#hashed_storage?(feature) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)

88
89
90
91
92
93
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 88

def hashed_storage?(feature)
  raise ArgumentError, "Invalid feature" unless HASHED_STORAGE_FEATURES.include?(feature)
  return false unless respond_to?(:storage_version)

  self.storage_version && self.storage_version >= HASHED_STORAGE_FEATURES[feature]
end

#repository_storage_pathObject


79
80
81
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 79

def repository_storage_path
  Gitlab.config.repositories.storages[repository_storage].legacy_disk_path
end