Browse Source

Add missing model associations

pull/8/head
Angel Aviel Domaoan 4 years ago committed by Angel Aviel Domaoan
parent
commit
93194ee85e
  1. 5
      app/models/cdao/jurisprudence.rb

5
app/models/cdao/jurisprudence.rb

@ -1,8 +1,13 @@
class Cdao::Jurisprudence < Cdao::Base class Cdao::Jurisprudence < Cdao::Base
self.table_name = "jurisprudences" self.table_name = "jurisprudences"
has_many :annotations, as: :document, dependent: :restrict_with_error
has_many :doctrines, as: :document, dependent: :restrict_with_error has_many :doctrines, as: :document, dependent: :restrict_with_error
has_many :annotation_documents, as: :document, dependent: :restrict_with_error
has_many :annotations_as_cited, through: :annotation_documents, source: :annotation
alias_attribute :doc_date, :docdate alias_attribute :doc_date, :docdate
def subjects def subjects

Loading…
Cancel
Save