blob: 33c5dc15fa43345d303ecf8e5c9485419cce8bee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# frozen_string_literal: true
module DesignManagement
class Repository < ApplicationRecord
include ::Gitlab::Utils::StrongMemoize
include HasRepository
belongs_to :project, inverse_of: :design_management_repository
validates :project, presence: true, uniqueness: true
delegate :lfs_enabled?, :storage, :repository_storage, to: :project
def repository
::DesignManagement::GitRepository.new(
full_path,
self,
shard: repository_storage,
disk_path: disk_path,
repo_type: repo_type
)
end
strong_memoize_attr :repository
def full_path
project.full_path + repo_type.path_suffix
end
def disk_path
project.disk_path + repo_type.path_suffix
end
def repo_type
Gitlab::GlRepository::DESIGN
end
end
end
|