aptible-rails 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aptible/rails/decorators/criterion_decorator.rb +23 -4
- data/lib/aptible/rails/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: 3066c48b9a5b96899937c0c23988dd3b36c13521
|
4
|
+
data.tar.gz: 2c8803908cbb25765394f860e45dd5be751e90c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02363f08cb34ae5ccf3dea12d1ed8d2c1a4c586b2ba4cc16d3019ce1aca8441067bb3aa092e8dab2a7ff77cf3ecdebf51803399b262c186698b739fc485a8d3a
|
7
|
+
data.tar.gz: f657334321415dd36fb9e06d2d126b08c2e2c718b10062ad3dd11a2df9276fe631af07a7915a30c904f88c3e57bf85be8a0b1106157a6925df01e7f11451e69f
|
@@ -17,13 +17,32 @@ class CriterionDecorator < ApplicationDecorator
|
|
17
17
|
self.class.status_description(object.status)
|
18
18
|
end
|
19
19
|
|
20
|
+
# rubocop:disable MethodLength
|
20
21
|
def update_summary
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
case object.scope
|
23
|
+
when 'organization'
|
24
|
+
if current_document
|
25
|
+
"Updated #{h.time_ago_in_words(current_document.created_at)} ago"
|
26
|
+
else
|
27
|
+
'Never updated'
|
28
|
+
end
|
29
|
+
when 'app'
|
30
|
+
count = unique_app_count
|
31
|
+
"Completed for #{count} #{'app'.pluralize(count)}"
|
32
|
+
when 'user'
|
33
|
+
count = unique_user_count
|
34
|
+
"Completed for #{count} #{'user'.pluralize(count)}"
|
25
35
|
end
|
26
36
|
end
|
37
|
+
# rubocop:enable MethodLength
|
38
|
+
|
39
|
+
def unique_user_count
|
40
|
+
object.documents.map { |d| d.links['user'].href }.uniq.count
|
41
|
+
end
|
42
|
+
|
43
|
+
def unique_app_count
|
44
|
+
object.documents.map { |d| d.links['app'].href }.uniq.count
|
45
|
+
end
|
27
46
|
|
28
47
|
def current_document
|
29
48
|
documents.first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptible-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|