|
|
|
@ -9,8 +9,7 @@ class Doctrine < ApplicationRecord |
|
|
|
|
|
|
|
|
|
|
|
has_many :annotations, dependent: :destroy |
|
|
|
has_many :annotations, dependent: :destroy |
|
|
|
|
|
|
|
|
|
|
|
validates :content, presence: true |
|
|
|
validates :content, :headnote, presence: true |
|
|
|
validates :content_fingerprint, uniqueness: true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before_validation do |
|
|
|
before_validation do |
|
|
|
self.content_fingerprint = Digest::SHA256.hexdigest(content) |
|
|
|
self.content_fingerprint = Digest::SHA256.hexdigest(content) |
|
|
|
|