app/models/digital_asset.rb in daengine-0.3.1 vs app/models/digital_asset.rb in daengine-0.3.2
- old
+ new
@@ -111,9 +111,26 @@
def is_institutional_use?
audiences.index('491') ? true : false
end
+ def product
+ TaxonomyTerm.label_for_term(product_ids[0])
+ end
+ def program
+ TaxonomyTerm.label_for_term(program_ids[0])
+ end
+ def content_org
+ TaxonomyTerm.label_for_term(content_organization_ids[0])
+ end
+ def content_type
+ type_id = documents.detect{|d| d.content_type != '549'}.try(:content_type)
+ TaxonomyTerm.label_for_term(type_id)
+ end
+ def audience
+ TaxonomyTerm.label_for_term(audiences[0])
+ end
+
end
class DigitalAsset::Document
include Mongoid::Document