app/models/digital_asset.rb in daengine-0.2.0 vs app/models/digital_asset.rb in daengine-0.2.1
- old
+ new
@@ -14,10 +14,11 @@
field :expires_at, type: Time
field :guid, type: String
field :fund_ids, type: Array, default: []
field :business_owner, type: String
field :summary, type: String
+ field :content_organization_ids, type: Array, default: []
key :guid
# field :documents, type: Hash
@@ -28,9 +29,10 @@
scope :title_is, ->(title) { where(:title => title)}
scope :business_owner_is, ->(business_owner) { where(:business_owner => business_owner)}
scope :guid_is, ->(guid) { where(:guid => guid)}
scope :funds_in, ->(fund_id) { where(:fund_ids.in => fund_id)}
scope :audience_in, ->(audience_id) {where(:audiences.in => audience_id)}
+ scope :content_organization_in, ->(content_organization_id) {where(:content_organization_ids.in => content_organization_id)}
scope :sami_is, ->(sami_code) {where(:sami_code => sami_code)}
scope :path_is, ->(path) {where(:'documents.path' => path)}
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)}