app/models/digital_asset.rb in daengine-0.2.19 vs app/models/digital_asset.rb in daengine-0.3
- old
+ new
@@ -25,10 +25,11 @@
# field :fund_ids, type: Array, default: []
field :business_owner, type: String
field :summary, type: String
field :content_organization_ids, type: Array, default: []
field :program_ids, type: Array, default: []
+
field :omniture_codes, type: Array, default: []
field :orderable, :type => Boolean
key :guid
# field :documents, type: Hash
@@ -49,10 +50,13 @@
scope :doctype_in, ->(types) {where(:'documents.content_type'.in => types)}
scope :product_in, ->(types) {where(:product_ids.in => types)}
scope :stale, -> {where(:updated_at.lte => 2.minutes.ago)}
scope :orderable_is, ->(orderable) {where(:orderable => orderable)}
scope :orderable, -> {where(orderable: true)}
+ scope :has_finra, -> {where(:'documents.content_type' => '549')}
+ scope :audience_in, ->(audience) {where(:audiences.in => audience)}
+ # scope :order_by_fund, order_by[[:product_ids, :asc]]
# validations
validates_presence_of :guid, :title, :changed_at, :published_at,
:expires_at, :audiences, :documents
@@ -115,9 +119,13 @@
include Mongoid::Document
field :path, type: String
field :doc_changed_at, type: Time
field :content_type, type: String
+ field :pages, type: Integer, default: 0
+ field :size, type: String
+ field :mime_type, type: String
+
embedded_in :digital_asset
key :path
validates_uniqueness_of :path