|
|
|
@ -12,6 +12,14 @@ class Cdao::Jurisprudence < Cdao::Base |
|
|
|
|
|
|
|
|
|
|
|
alias_attribute :doc_date, :docdate |
|
|
|
alias_attribute :doc_date, :docdate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def libraries |
|
|
|
|
|
|
|
Cdao::DocumentLibrary.where(library_product_type: self.class.name.gsub("Cdao::", ""), library_product_id: id).map(&:library) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_only_in_premium_libraries? |
|
|
|
|
|
|
|
libraries.all?(&:premium?) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def cited_documents |
|
|
|
def cited_documents |
|
|
|
Cdao::Citation.where(citing_doc_id: self.id, citing_doc_type: self.class.name.gsub("Cdao::", "")) |
|
|
|
Cdao::Citation.where(citing_doc_id: self.id, citing_doc_type: self.class.name.gsub("Cdao::", "")) |
|
|
|
end |
|
|
|
end |
|
|
|
@ -147,6 +155,10 @@ class Cdao::Jurisprudence < Cdao::Base |
|
|
|
|
|
|
|
|
|
|
|
boolean :edited |
|
|
|
boolean :edited |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean :is_only_in_premium_libraries do |
|
|
|
|
|
|
|
is_only_in_premium_libraries? |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
join(:phil_rep, :target => Annotation, :type => :string, :join => { :from => :document_id, :to => :id }) |
|
|
|
join(:phil_rep, :target => Annotation, :type => :string, :join => { :from => :document_id, :to => :id }) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|