daengine 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -113,6 +113,23 @@ class DigitalAsset
113
113
  audiences.index('491') ? true : false
114
114
  end
115
115
 
116
+ def product
117
+ TaxonomyTerm.label_for_term(product_ids[0])
118
+ end
119
+ def program
120
+ TaxonomyTerm.label_for_term(program_ids[0])
121
+ end
122
+ def content_org
123
+ TaxonomyTerm.label_for_term(content_organization_ids[0])
124
+ end
125
+ def content_type
126
+ type_id = documents.detect{|d| d.content_type != '549'}.try(:content_type)
127
+ TaxonomyTerm.label_for_term(type_id)
128
+ end
129
+ def audience
130
+ TaxonomyTerm.label_for_term(audiences[0])
131
+ end
132
+
116
133
  end
117
134
 
118
135
  class DigitalAsset::Document
@@ -25,4 +25,8 @@ class TaxonomyTerm
25
25
  TaxonomyTerm.destroy_all
26
26
  end
27
27
 
28
+ def self.label_for_term(term_id)
29
+ where(term_id: term_id).try(:first).try(:label)
30
+ end
31
+
28
32
  end
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.3.2
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-08-24 00:00:00.000000000Z
13
+ date: 2012-08-25 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails