Permalink
Browse files

Push more nil-checks down.

  • Loading branch information...
1 parent 57f3623 commit a72e31b131f3bc21d7caf04b739b3a9c167f30b0 Gabe Berke-Williams committed Jan 13, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/fake_braintree/customer.rb
@@ -14,7 +14,7 @@ def create
response_for_invalid_card
else
hash = customer_hash
- credit_cards = hash["credit_cards"] || []
+ credit_cards = hash["credit_cards"]
create_customer_with(hash)
credit_cards.each { |card| add_credit_card_to_registry(card) }
response_for_created_customer(hash)
@@ -58,6 +58,8 @@ def customer_hash
credit_card = hash.delete("credit_card")
hash["credit_cards"] = [credit_card]
end
+ else
+ hash["credit_cards"] = []
end
hash

0 comments on commit a72e31b

Please sign in to comment.