daengine 0.3.8.2 → 0.3.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/digital_asset.rb +10 -4
- data/app/models/taxonomy_term.rb +15 -0
- data/lib/daengine/taxonomy_parser.rb +2 -1
- data/lib/daengine/version.rb +1 -1
- metadata +2 -2
data/app/models/digital_asset.rb
CHANGED
@@ -72,7 +72,7 @@ class DigitalAsset
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def path_is(path)
|
75
|
-
documents.where(path: path).first
|
75
|
+
documents.where(path: path).first unless documents.blank?
|
76
76
|
end
|
77
77
|
|
78
78
|
def doc_changed_at(path)
|
@@ -139,7 +139,11 @@ class DigitalAsset
|
|
139
139
|
|
140
140
|
private
|
141
141
|
|
142
|
-
def first_non_finra
|
142
|
+
def first_non_finra
|
143
|
+
documents.try(:detect) do |d|
|
144
|
+
d.content_type != ContentType::FINRA
|
145
|
+
end
|
146
|
+
end
|
143
147
|
|
144
148
|
|
145
149
|
end
|
@@ -172,8 +176,8 @@ class DigitalAsset::ContentType
|
|
172
176
|
COMMENTARY = '532'
|
173
177
|
FUND_YIELD = '538'
|
174
178
|
FLYER = '511'
|
175
|
-
|
176
|
-
|
179
|
+
L_SHARE_YIELD_SHEET = 'MCOBX14FY'
|
180
|
+
P_SHARE_YIELD_SHEET = 'MCOBYY7SX'
|
177
181
|
ANNUAL_REPORT = '529'
|
178
182
|
SEMIANNUAL_REPORT = '541'
|
179
183
|
SAI = '540'
|
@@ -182,6 +186,8 @@ class DigitalAsset::ContentType
|
|
182
186
|
MONTHLY_HOLDINGS = 'MA53Y14FY'
|
183
187
|
BUSINESS_CALENDAR = 'MA540I7SX'
|
184
188
|
WEEKLY_HOLDINGS = 'MA542HDIJ'
|
189
|
+
FUND_DOCUMENTS = '528'
|
190
|
+
FORMS_AND_APPLICATIONS = '496'
|
185
191
|
end
|
186
192
|
|
187
193
|
class DigitalAsset::Audience
|
data/app/models/taxonomy_term.rb
CHANGED
@@ -29,4 +29,19 @@ class TaxonomyTerm
|
|
29
29
|
where(term_id: term_id).try(:first).try(:label) if term_id
|
30
30
|
end
|
31
31
|
|
32
|
+
def ancestor?(term)
|
33
|
+
if(parent_term)
|
34
|
+
(parent_term == term) or parent_term.ancestor?(term)
|
35
|
+
else
|
36
|
+
false
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def descendant?(term)
|
41
|
+
# accept either an ID string or a term
|
42
|
+
term_id = term.is_a?(String) ? term : term.try(:term_id)
|
43
|
+
# loop thru child terms and look for the id
|
44
|
+
child_term_ids.index(term_id) or child_terms.detect {|c| c.descendant? term_id }
|
45
|
+
end
|
46
|
+
|
32
47
|
end
|
@@ -45,6 +45,7 @@ module Daengine::TaxonomyParser
|
|
45
45
|
unless my_terms.nil?
|
46
46
|
entity.xpath('term').map do |j|
|
47
47
|
a_term = parse_taxonomy_term(j)
|
48
|
+
a_term.parent_term = category
|
48
49
|
category.child_terms << a_term
|
49
50
|
end
|
50
51
|
end
|
@@ -52,7 +53,7 @@ module Daengine::TaxonomyParser
|
|
52
53
|
category.save!
|
53
54
|
rescue Exception => e
|
54
55
|
#puts "--**Exception**-- #{e}"
|
55
|
-
|
56
|
+
p "Failed to add record #{category.try(:label)}, #{category.try(:errors).try(:full_messages)}"
|
56
57
|
end
|
57
58
|
category
|
58
59
|
end
|
data/lib/daengine/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: daengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.8.
|
5
|
+
version: 0.3.8.3
|
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: 2012-
|
13
|
+
date: 2012-11-02 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|