Skip to content

Commit

Permalink
Push more nil-checks down.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Jan 13, 2012
1 parent 57f3623 commit a72e31b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fake_braintree/customer.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a72e31b

Please sign in to comment.