Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pool_repository.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bad0e30ceb56f77ad9a8968f7db6fcb20ec3fdc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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