accounts_client 0.2.31 → 0.2.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/padma_account.rb +21 -0
- 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: 70cc60e87f3219ae65b487a3288238b94b0b4a76
|
4
|
+
data.tar.gz: eda096f0442b8055e41dc5aeee648db581ff41b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23d807b21aa548c681e2c00cf993b9f0da1d435762a6f1664e88f144dc9af855ec715940ad712e4a18ea83f92ca4c176ba8843cc32199c8c0ca2eda694162287
|
7
|
+
data.tar.gz: aeeea75569120454eabf1fe32d3fff7d42b650d92d4b21bfa20c8da737c0e63f6ba8b4953787d48f49bb1b69ab9a3c16d062bc56188f05ff7bdc6a19c3eb40d7
|
data/app/models/padma_account.rb
CHANGED
@@ -6,6 +6,7 @@ class PadmaAccount < LogicalModel
|
|
6
6
|
set_resource_path "/v0/accounts"
|
7
7
|
|
8
8
|
attribute :name
|
9
|
+
attribute :vanity_name
|
9
10
|
attribute :enabled
|
10
11
|
attribute :timezone
|
11
12
|
attribute :locale
|
@@ -73,6 +74,26 @@ class PadmaAccount < LogicalModel
|
|
73
74
|
res
|
74
75
|
end
|
75
76
|
|
77
|
+
def self.find_by_vanity_name(vanity_name, params={})
|
78
|
+
res = nil
|
79
|
+
params = self.merge_key(params)
|
80
|
+
request = Typhoeus::Request.new("#{resource_uri}/by_vanity_name/#{vanity_name}", params: params )
|
81
|
+
|
82
|
+
request.on_complete do |response|
|
83
|
+
if response.code >= 200 && response.code < 400
|
84
|
+
log_ok(response)
|
85
|
+
res = self.new.from_json(response.body)
|
86
|
+
else
|
87
|
+
log_failed(response)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
self.hydra.queue(request)
|
92
|
+
self.hydra.run
|
93
|
+
|
94
|
+
res
|
95
|
+
end
|
96
|
+
|
76
97
|
def self.find_with_rails_cache(account_name,options={})
|
77
98
|
pa = Rails.cache.read([account_name,"padma_account"])
|
78
99
|
if pa.nil? || options[:refresh]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accounts_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|