lib/fake_braintree/credit_card.rb
# When updating a card that has 'default' set to true, make sure only one
# card has the flag.
When updating a card that has 'default' set to true, make sure only one
card has the flag.
When updating a card that has ' default ' set to true make sure only one card has the flag .
def update_default_card
      if @credit_card['default']
        FakeBraintree.registry.customers[@credit_card['customer_id']]['credit_cards'].each do |card|
          card['default'] = false
        end
        @credit_card['default'] = true
      end
    end
def update_default_card if @credit_card [ 'default' ] FakeBraintree . registry . customers [ @credit_card [ 'customer_id' ] ] [ 'credit_cards' ] . each do | card | card [ 'default' ] = false end @credit_card [ 'default' ] = true end end
When updating a card that has 'default' set to true, make sure only one
card has the flag.
When updating a card that has ' default ' set to true make sure only one card has the flag .