daengine 0.4.7.3 → 0.4.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,6 @@ class DigitalAsset
4
4
  include Mongoid::Document
5
5
  include Mongoid::Timestamps
6
6
 
7
-
8
7
  field :title, type: String
9
8
  field :changed_at, type: Time
10
9
  field :audiences, type: Array, default: []
@@ -55,6 +54,7 @@ class DigitalAsset
55
54
  scope :audience_in, ->(audience) {where(:audiences.in => audience)}
56
55
  scope :alphabetical, order_by(:title => :asc)
57
56
  scope :not_xbrl, -> {excludes(:'documents.content_type' => ContentType::XBRL_DOCUMENT)}
57
+
58
58
  #scope :order_by_fund, order_by[[:product_ids, :asc]]
59
59
  #default_scope {not_in(:'documents.content_type' => ["LDJDCMAIK"])}
60
60
 
@@ -218,9 +218,37 @@ class DigitalAsset::ContentType
218
218
  FUND_DOCUMENTS = '528'
219
219
  FORMS_AND_APPLICATIONS = '496'
220
220
  XBRL_DOCUMENT = 'LDJDCMAIK'
221
+
222
+ FUND_DOC_TYPES = [DAILY_HOLDINGS, WEEKLY_HOLDINGS, MONTHLY_HOLDINGS, COMMENTARY,FACTSHEET,
223
+ PROSPECTUS,SUMMARY_PROSPECTUS,ANNUAL_REPORT,SEMIANNUAL_REPORT,SAI,BUSINESS_CALENDAR,FUND_YIELD,
224
+ L_SHARE_YIELD_SHEET, P_SHARE_YIELD_SHEET
225
+ ]
221
226
  end
222
227
 
223
228
  class DigitalAsset::Audience
224
229
  INVESTOR_APPROVED = '490'
225
230
  INSTITUTIONAL_USE = '491'
226
231
  end
232
+
233
+
234
+ FUND_DOC_ORDER = {
235
+ :daily_holdings => [DigitalAsset::ContentType::DAILY_HOLDINGS],
236
+ :weekly_holdings => [DigitalAsset::ContentType::WEEKLY_HOLDINGS],
237
+ :current_monthly_holdings => [
238
+ DigitalAsset::ContentType::MONTHLY_HOLDINGS,
239
+ lambda {|docs| docs[0] ? [docs[0]] : [] }
240
+ ],
241
+ :commentary => [DigitalAsset::ContentType::COMMENTARY],
242
+ :factsheet => [DigitalAsset::ContentType::FACTSHEET],
243
+ :prospectus => [DigitalAsset::ContentType::PROSPECTUS],
244
+ :summary_prospectus => [DigitalAsset::ContentType::SUMMARY_PROSPECTUS],
245
+ :annual_report => [DigitalAsset::ContentType::ANNUAL_REPORT],
246
+ :semiannual_report => [DigitalAsset::ContentType::SEMIANNUAL_REPORT],
247
+ :sai => [DigitalAsset::ContentType::SAI],
248
+ :business_calendar => [DigitalAsset::ContentType::BUSINESS_CALENDAR],
249
+ :prior_monthly_holdings => [
250
+ DigitalAsset::ContentType::MONTHLY_HOLDINGS,
251
+ lambda {|docs| docs }
252
+ ],
253
+ :fund_yield => [DigitalAsset::ContentType::FUND_YIELD]
254
+ }
@@ -2,7 +2,7 @@ class DigitalAssetLookupService
2
2
 
3
3
  def self.find_documents_by_fund_code(fund_codes)
4
4
  ids = fund_codes.collect {|c| term_id_from_fund_code(c)}
5
- DigitalAsset.product_in ids
5
+ DigitalAsset.unscoped.content_type_in(DigitalAsset::ContentType::FUND_DOC_TYPES).product_in ids
6
6
  end
7
7
 
8
8
  def self.fund_code_from_id(taxonomy_id)
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.4.7.3"
2
+ VERSION = "0.4.7.5"
3
3
  end
File without changes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.7.3
5
+ version: 0.4.7.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - sbhatia
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-28 00:00:00.000000000Z
13
+ date: 2013-03-02 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -139,6 +139,7 @@ files:
139
139
  - spec/dummy/config/initializers/wrap_parameters.rb
140
140
  - spec/dummy/config/locales/en.yml
141
141
  - spec/dummy/db/test.sqlite3
142
+ - spec/dummy/log/development.log
142
143
  - spec/dummy/public/404.html
143
144
  - spec/dummy/public/422.html
144
145
  - spec/dummy/public/500.html
@@ -229,6 +230,7 @@ test_files:
229
230
  - spec/dummy/config/initializers/wrap_parameters.rb
230
231
  - spec/dummy/config/locales/en.yml
231
232
  - spec/dummy/db/test.sqlite3
233
+ - spec/dummy/log/development.log
232
234
  - spec/dummy/public/404.html
233
235
  - spec/dummy/public/422.html
234
236
  - spec/dummy/public/500.html