summaryrefslogtreecommitdiff
path: root/app/models/snippet_repository.rb
blob: ba2a061a5f4820d69aaedbcce40bc9a0c67ea05a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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