diff options
author | Toon Claes <toon@gitlab.com> | 2018-11-29 19:08:14 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-11-29 19:08:14 +0300 |
commit | 198fdc54789dcb24efb0622a23e6931d83e1faa6 (patch) | |
tree | 82c4d1926bd246fb857bb5ad9adaf68c45982dd5 /app/models/project_repository.rb | |
parent | 6775dafa3816239f6fa1b12428df42572be5a158 (diff) |
Store hashed storage paths in the database
Diffstat (limited to 'app/models/project_repository.rb')
-rw-r--r-- | app/models/project_repository.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/project_repository.rb b/app/models/project_repository.rb new file mode 100644 index 00000000000..38913f3f2f5 --- /dev/null +++ b/app/models/project_repository.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ProjectRepository < ActiveRecord::Base + include Shardable + + belongs_to :project, inverse_of: :project_repository + + class << self + def find_project(disk_path) + find_by(disk_path: disk_path)&.project + end + end +end |