daengine 0.6.8 → 0.6.9
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.
- checksums.yaml +4 -4
- data/app/controllers/digital_assets_controller.rb +1 -1
- data/app/models/digital_asset.rb +4 -46
- data/lib/daengine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f8ed9d8c7af0066811198c5910651a6e3daa745
|
4
|
+
data.tar.gz: b0eb43af0825e3a83b2aa8efb81b30d0ce9d98cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f50d5b2926c4fccf91aebb0ef7f947df97deb2c5f2f72122e2a372a7bd0ecef2eccf688b4a8fb8eda72f20626eeff9321637c6a29729777f780819f23ca65a1
|
7
|
+
data.tar.gz: e3fa80856d2f40d73a8f29f47103c1b357f08c35dd61698e7a30a65afcd287b77dfb9cceba7d77c1b42391cea2b04b015010e1e7b528a55e8f141964785b076e
|
@@ -14,7 +14,7 @@ class DigitalAssetsController < ApplicationController
|
|
14
14
|
#/digital_assets/search/sami_code=NE00192&title=Fund%20Prospectus&fund_code=20293
|
15
15
|
def index
|
16
16
|
search_params = params[:search] || request.query_parameters
|
17
|
-
@digital_assets = search_params ? search_da(search_params) : DigitalAsset.all
|
17
|
+
@digital_assets = search_params.present? ? search_da(search_params) : DigitalAsset.all
|
18
18
|
# respond_with(@digital_assets)
|
19
19
|
render json: @digital_assets
|
20
20
|
end
|
data/app/models/digital_asset.rb
CHANGED
@@ -36,11 +36,6 @@ class DigitalAsset
|
|
36
36
|
field :digital_asset_id, type: String
|
37
37
|
key :digital_asset_id
|
38
38
|
|
39
|
-
# field :documents, type: Hash
|
40
|
-
# embeds_many :documents, :class_name => 'DigitalAsset::Document'
|
41
|
-
# accepts_nested_attributes_for :documents
|
42
|
-
|
43
|
-
|
44
39
|
#Exclude XBRL documents from all queries
|
45
40
|
default_scope excludes(:'content_type' => "LDJDCMAIK") #Had to use static value instead of a Constant
|
46
41
|
|
@@ -74,9 +69,9 @@ class DigitalAsset
|
|
74
69
|
validates_uniqueness_of :path, :digital_asset_id
|
75
70
|
validate :validate_future_expiration
|
76
71
|
|
77
|
-
|
78
|
-
|
79
|
-
|
72
|
+
def guid
|
73
|
+
super || digital_asset_id
|
74
|
+
end
|
80
75
|
|
81
76
|
def self.purge!
|
82
77
|
DigitalAsset.stale.destroy_all if bulk_processed?
|
@@ -84,12 +79,6 @@ class DigitalAsset
|
|
84
79
|
|
85
80
|
def latest_doc_changed_at
|
86
81
|
doc_changed_at
|
87
|
-
# documents.reduce(nil) do |latest_date, d|
|
88
|
-
# unless d.content_type == '549'
|
89
|
-
# latest_date = d.doc_changed_at if (latest_date == nil || latest_date < d.doc_changed_at)
|
90
|
-
# end
|
91
|
-
# latest_date
|
92
|
-
# end
|
93
82
|
end
|
94
83
|
|
95
84
|
def validate_future_expiration
|
@@ -100,27 +89,6 @@ class DigitalAsset
|
|
100
89
|
(stale.count.to_f / self.count) <= 0.05
|
101
90
|
end
|
102
91
|
|
103
|
-
# def path_is(path)
|
104
|
-
# documents.where(path: path).first unless documents.blank?
|
105
|
-
# end
|
106
|
-
|
107
|
-
# def doc_changed_at(path)
|
108
|
-
# path_is(path).try(:doc_changed_at)
|
109
|
-
# end
|
110
|
-
|
111
|
-
# def doc_size
|
112
|
-
# first_non_finra.try(:size)
|
113
|
-
# end
|
114
|
-
|
115
|
-
# def content_type_ids
|
116
|
-
# ids = []
|
117
|
-
# documents.try(:each) do |d|
|
118
|
-
# ids << d.content_type
|
119
|
-
# end
|
120
|
-
# ids
|
121
|
-
# end
|
122
|
-
# alias :doctype_ids :content_type_ids
|
123
|
-
|
124
92
|
def has_finra?
|
125
93
|
finra_path.present?
|
126
94
|
end
|
@@ -129,11 +97,6 @@ class DigitalAsset
|
|
129
97
|
expires_at < Time.now
|
130
98
|
end
|
131
99
|
|
132
|
-
# def finra_document
|
133
|
-
# finra_idx = documents.index {|d| d.content_type == ContentType::FINRA}
|
134
|
-
# documents[finra_idx] if finra_idx
|
135
|
-
# end
|
136
|
-
|
137
100
|
def is_investor_approved?
|
138
101
|
audiences.index(DigitalAsset::Audience::INVESTOR_APPROVED)
|
139
102
|
end
|
@@ -154,11 +117,6 @@ class DigitalAsset
|
|
154
117
|
TaxonomyTerm.label_for_term(content_organization_ids[0])
|
155
118
|
end
|
156
119
|
|
157
|
-
# def fund_code
|
158
|
-
# pid = product_ids.find {|pid| TaxonomyTerm.term_id_is(pid)[0].try(:fund_code)}
|
159
|
-
# pid and TaxonomyTerm.term_id_is(pid)[0].try(:fund_code).try(:rjust, 5, '0')
|
160
|
-
# end
|
161
|
-
|
162
120
|
def content_type_label
|
163
121
|
TaxonomyTerm.label_for_term(content_type_id)
|
164
122
|
end
|
@@ -168,7 +126,7 @@ class DigitalAsset
|
|
168
126
|
end
|
169
127
|
|
170
128
|
def primary_path
|
171
|
-
|
129
|
+
path
|
172
130
|
end
|
173
131
|
|
174
132
|
def primary_extension
|
data/lib/daengine/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sbhatia
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|