aptible-rails 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077945c2763d300c6ffa78be59b3dc4176223cc0
|
4
|
+
data.tar.gz: ec99d37daa03c53066674c192900d437107e8e33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8963c514e3419f5e7a8c18e38a149f6a3ad193f59ad5a70a7f5793509c1cd4b865008b05a0847702c181bbc47596ac380da3ecfbf00f841c2c1fab7e9fdc403
|
7
|
+
data.tar.gz: 58e85c52421f23c6b00c48354e3d1dac1354cd41fd8a537bffd2fadf77bb30292524c7306195d6d03c2d91066be4057de17c4f69ce86dc8ddc764dca9e00305e
|
@@ -28,11 +28,12 @@ module Aptible
|
|
28
28
|
return @current_organization if @current_organization
|
29
29
|
url = read_shared_cookie(:organization_url)
|
30
30
|
@current_organization = Aptible::Auth::Organization.find_by_url(
|
31
|
-
|
32
|
-
|
31
|
+
url, token: session_token) if url
|
32
|
+
@current_organization ||= default_organization
|
33
|
+
|
33
34
|
rescue HyperResource::ClientError => e
|
34
35
|
raise e unless e.body['code'] == 403
|
35
|
-
|
36
|
+
@current_organization = default_organization
|
36
37
|
end
|
37
38
|
|
38
39
|
def current_organization=(organization)
|
@@ -43,8 +44,7 @@ module Aptible
|
|
43
44
|
token_subject || session_subject
|
44
45
|
end
|
45
46
|
|
46
|
-
|
47
|
-
def set_default_organization
|
47
|
+
def default_organization
|
48
48
|
return @current_organization if @current_organization
|
49
49
|
orgs = Aptible::Auth::Organization.all(token: session_token)
|
50
50
|
self.current_organization = orgs.first if orgs.any?
|
@@ -17,4 +17,10 @@ class ResourceDecorator < ApplicationDecorator
|
|
17
17
|
return nil unless object.last_operation
|
18
18
|
@last_operation ||= OperationDecorator.decorate(object.last_operation)
|
19
19
|
end
|
20
|
+
|
21
|
+
def operation_count
|
22
|
+
garner.bind(h.controller.session_token).bind(object) do
|
23
|
+
object.operations.count
|
24
|
+
end
|
25
|
+
end
|
20
26
|
end
|
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.6.
|
4
|
+
version: 0.6.9
|
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-12-
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_config
|