lib/recurly/subscription/add_ons.rb in recurly-2.0.9 vs lib/recurly/subscription/add_ons.rb in recurly-2.0.10
- old
+ new
@@ -25,9 +25,10 @@
def << add_on
case add_on
when AddOn then add_on = { :add_on_code => add_on.add_on_code }
when String, Symbol then add_on = { :add_on_code => add_on.to_s }
end
+ add_on = Helper.hash_with_indifferent_read_access add_on
exist = @add_ons.find { |a| a[:add_on_code] == add_on[:add_on_code] }
if exist
exist[:quantity] ||= 1 and exist[:quantity] += 1