gitlab-org--gitlab-foss/app/models/pool_repository.rb

21 lines
383 B
Ruby
Raw Normal View History

2018-10-18 23:44:41 -04:00
# frozen_string_literal: true
class PoolRepository < ActiveRecord::Base
include Shardable
2018-10-18 23:44:41 -04:00
has_many :member_projects, class_name: 'Project'
2018-10-18 23:44:41 -04:00
after_create :correct_disk_path
2018-10-18 23:44:41 -04:00
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
2018-10-18 23:44:41 -04:00
end