Browse Source

Fix validation for `doctrine`

pull/105/head
alexdbondoc17 4 years ago
parent
commit
19c3b09136
  1. 3
      app/models/doctrine.rb

3
app/models/doctrine.rb

@ -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)

Loading…
Cancel
Save