From f7a3021ca427c5edbdcc5e6e3b3ed2ff4ae4bd3d Mon Sep 17 00:00:00 2001 From: Angel Aviel Domaoan Date: Mon, 31 Jan 2022 05:50:46 +0000 Subject: [PATCH] Add missing model associations --- app/models/cdao/jurisprudence.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/cdao/jurisprudence.rb b/app/models/cdao/jurisprudence.rb index 48f05d4..daa960b 100644 --- a/app/models/cdao/jurisprudence.rb +++ b/app/models/cdao/jurisprudence.rb @@ -1,8 +1,13 @@ class Cdao::Jurisprudence < Cdao::Base self.table_name = "jurisprudences" + has_many :annotations, 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 def subjects