gitlab-org--gitlab-foss/app/models/pool_repository.rb
2018-11-29 16:08:14 +00:00

20 lines
383 B
Ruby

# frozen_string_literal: true
class PoolRepository < ActiveRecord::Base
include Shardable
has_many :member_projects, class_name: 'Project'
after_create :correct_disk_path
private
def correct_disk_path
update!(disk_path: storage.disk_path)
end
def storage
Storage::HashedProject
.new(self, prefix: Storage::HashedProject::POOL_PATH_PREFIX)
end
end