daengine 0.3.7.5 → 0.3.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -71,6 +71,14 @@ class DigitalAsset
71
71
  (stale.count.to_f / self.count) <= 0.05
72
72
  end
73
73
 
74
+ def path_is(path)
75
+ documents.where(path: path).first
76
+ end
77
+
78
+ def doc_changed_at(path)
79
+ path_is(path).try(:doc_changed_at)
80
+ end
81
+
74
82
  def content_type_ids
75
83
  ids = []
76
84
  documents.try :each do |d|
@@ -92,10 +100,12 @@ class DigitalAsset
92
100
  def is_investor_approved?
93
101
  audiences.index(DigitalAsset::Audience::INVESTOR_APPROVED)
94
102
  end
103
+ alias :investor_approved? :is_investor_approved?
95
104
 
96
105
  def is_institutional_use?
97
106
  audiences.index(DigitalAsset::Audience::INSTITUTIONAL_USE)
98
107
  end
108
+ alias :institutional_use? :is_institutional_use?
99
109
 
100
110
  def product
101
111
  TaxonomyTerm.label_for_term(product_ids[0])
@@ -12,7 +12,11 @@ module Daengine
12
12
  cs.each do |c|
13
13
  if da.sami_code == c.samiCode
14
14
  da.orderable = c.orderable == 'true'
15
- da.save!
15
+ begin
16
+ da.save!
17
+ rescue Exception => e
18
+ p "unable to set orderable status for #{da.try(:primary_path)}, #{da.errors.try(:first)}"
19
+ end
16
20
  break
17
21
  end
18
22
  end
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.3.7.5"
2
+ VERSION = "0.3.7.7"
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.7.5
5
+ version: 0.3.7.7
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-09-17 00:00:00.000000000Z
13
+ date: 2012-10-05 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails