diff options
Diffstat (limited to 'billing/app/models')
-rw-r--r-- | billing/app/models/customer.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/billing/app/models/customer.rb b/billing/app/models/customer.rb index 515e204..f01c300 100644 --- a/billing/app/models/customer.rb +++ b/billing/app/models/customer.rb @@ -41,10 +41,11 @@ class Customer < CouchRest::Model::Base # based on 2nd parameter, either returns the single active subscription (or nil if there isn't one), or an array of all subsciptions def subscriptions(braintree_data=nil, only_active=true) + self.with_braintree_data! return unless has_payment_info? subscriptions = [] - credit_cards.first.subscriptions.each do |sub| + self.default_credit_card.subscriptions.each do |sub| if only_active and sub.status == 'Active' return sub else |