app/models/digital_asset.rb in daengine-0.2.12 vs app/models/digital_asset.rb in daengine-0.2.13
- old
+ new
@@ -69,9 +69,27 @@
documents.try :each do |d|
ids << d.content_type
end
ids
end
+
+ def has_finra?
+ finra_document != nil
+ end
+
+ def finra_document
+ finra_docs = documents.select {|d| d.content_type == '549'}
+ finra_docs.size == 1 ? finra_docs[0] : nil
+ end
+
+ def is_investor_approved?
+ audiences.index('490') ? true : false
+ end
+
+ def is_institutional_use?
+ audiences.index('491') ? true : false
+ end
+
end
class DigitalAsset::Document
include Mongoid::Document