Commit 91e52cef authored by Lior Sion's avatar Lior Sion
Browse files

Update card_helpers.rb

cards_or_sources[:total_count] || 0 + 1 -> 

if cards_or_sources[:total_count] == 0
  return 0
else 
  return 0 + 1 # return 1
end

I believe the meaning was:

 if cards_or_sources[:total_count] == 0 || cards_or_sources[:total_count].nil?
 return 1
else
return cards_or_sources[:total_count]  + 1
end
parent 0c1c7802
......@@ -29,7 +29,7 @@ module StripeMock
object[:default_source] = card[:id] if is_customer
cards_or_sources[:data] = [card]
else
cards_or_sources[:total_count] = cards_or_sources[:total_count] || 0 + 1
cards_or_sources[:total_count] = (cards_or_sources[:total_count] || 0) + 1
(cards_or_sources[:data] ||= []) << card
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment