aptible-auth 0.5.7 → 0.5.8

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: 0cba1c331d363d180358a0f2df28436a5a6ef08d
4
- data.tar.gz: 721da9291f441fee611130c4496007e5f799a467
3
+ metadata.gz: df3210695af43e5d27c23c0f37bba52806eb5f5c
4
+ data.tar.gz: 762d4d9ca811a0485a7f472c1fc4b421686df968
5
5
  SHA512:
6
- metadata.gz: d749065c3f32d30d0474966ddbfbb507ff57eecb60ade9a4b4f75e6ac3f1d8f054f0ceaab7db9c9c9df7080cf40723425fc4e464209035771daf5fe0373d58f8
7
- data.tar.gz: 571c6b6e88d2c021d988c019c4319df12b33832d17b3ac2d8e8c7376f5635f76ca84c37de7516589025805edfa22b7a8e85f060b5f8fc6092a9e350aab634604
6
+ metadata.gz: abf09317d563268e246d0847e206546623990230c9c628ade7bd30214788b7d6f2bb9cd416ffa5ce6926a224303ce987dba87dea09809463bbb39b204ca1c927
7
+ data.tar.gz: bfce953fdbd4aed03ef4b9c1b7137db9dab7b3d8311281720a1c509caf1d108651a4d7dc017b0cb1d4e384710655b4dfa92414b30448863b46ca13ded97889c8
@@ -24,6 +24,15 @@ module Aptible
24
24
  @stripe_customer ||= Stripe::Customer.retrieve(stripe_customer_id)
25
25
  end
26
26
 
27
+ def billing_contact
28
+ return nil unless stripe_customer.metadata['billing_contact']
29
+
30
+ @billing_contact ||=
31
+ User.find_by_url(
32
+ stripe_customer.metadata['billing_contact'],
33
+ token: token)
34
+ end
35
+
27
36
  def security_officer
28
37
  # REVIEW: Examine underlying data model for a less arbitrary solution
29
38
  security_officers_role = roles.find do |role|
@@ -47,6 +47,10 @@ module Aptible
47
47
  end
48
48
 
49
49
  # rubocop:disable PredicateName
50
+ def is_billing_contact?(organization)
51
+ organization.billing_contact && organization.billing_contact.id == id
52
+ end
53
+
50
54
  def has_role?(role)
51
55
  roles.select { |user_role| role.id == user_role.id }.count > 0
52
56
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Auth
3
- VERSION = '0.5.7'
3
+ VERSION = '0.5.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
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-06-16 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-resource