accounts_client 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/app/models/padma_account.rb +7 -2
  2. metadata +2 -2
@@ -9,6 +9,7 @@ class PadmaAccount < LogicalModel
9
9
  attribute :name
10
10
  attribute :enabled
11
11
  attribute :timezone
12
+ attribute :locale
12
13
  attribute :email
13
14
  attribute :full_name
14
15
  attribute :nucleo_id
@@ -24,11 +25,15 @@ class PadmaAccount < LogicalModel
24
25
  end
25
26
 
26
27
  def users
27
- PadmaUser.paginate :params => { :account_name => self.name }
28
+ PadmaUser.paginate(:account_name => self.name)
29
+ end
30
+
31
+ def admin
32
+ self.users.select {|u| u.roles.select {|r| r["name"] == "admin"}.first}.first
28
33
  end
29
34
 
30
35
  def contacts
31
- PadmaContact.paginate :params => { :account_name => self.name }
36
+ PadmaContact.paginate(:account_name => self.name)
32
37
  end
33
38
 
34
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accounts_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-28 00:00:00.000000000 Z
12
+ date: 2014-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties