app/models/digital_asset.rb in daengine-0.4.0.0 vs app/models/digital_asset.rb in daengine-0.4.0.1
- old
+ new
@@ -28,10 +28,11 @@
embeds_many :documents, :class_name => 'DigitalAsset::Document'
accepts_nested_attributes_for :documents
+ default_scope not_in(:'documents.content_type' => [ContentType::XBRL_DOCUMENT])
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)}
@@ -46,9 +47,10 @@
scope :orderable_is, ->(orderable) {where(:orderable => orderable)}
scope :orderable, -> {where(orderable: true)}
scope :has_finra, -> {where(:'documents.content_type' => ContentType::FINRA)}
scope :audience_in, ->(audience) {where(:audiences.in => audience)}
scope :alphabetical, order_by(:title => :asc)
+ #scope :not_xbrl, -> {excludes(:'documents.content_type' => ContentType::XBRL_DOCUMENT)}
# scope :order_by_fund, order_by[[:product_ids, :asc]]
# validations
validates_presence_of :guid, :title, :changed_at, :published_at,
:expires_at, :audiences, :documents