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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2018-11-29 19:08:14 +0300
committerNick Thomas <nick@gitlab.com>2018-11-29 19:08:14 +0300
commit198fdc54789dcb24efb0622a23e6931d83e1faa6 (patch)
tree82c4d1926bd246fb857bb5ad9adaf68c45982dd5 /app/models/project_repository.rb
parent6775dafa3816239f6fa1b12428df42572be5a158 (diff)
Store hashed storage paths in the database
Diffstat (limited to 'app/models/project_repository.rb')
-rw-r--r--app/models/project_repository.rb13
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