summaryrefslogtreecommitdiff
path: root/app/models/snippet_repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/snippet_repository.rb')
-rw-r--r--app/models/snippet_repository.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/snippet_repository.rb b/app/models/snippet_repository.rb
new file mode 100644
index 00000000000..ba2a061a5f4
--- /dev/null
+++ b/app/models/snippet_repository.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class SnippetRepository < ApplicationRecord
+ include Shardable
+
+ belongs_to :snippet, inverse_of: :snippet_repository
+
+ class << self
+ def find_snippet(disk_path)
+ find_by(disk_path: disk_path)&.snippet
+ end
+ end
+end