lib/money/money.rb in ShadowBelmolve-money-2.3.5 vs lib/money/money.rb in ShadowBelmolve-money-2.3.7
- old
+ new
@@ -97,9 +97,10 @@
other_money.respond_to?(:cents) && cents == other_money.cents &&
other_money.respond_to?(:currency) && bank.same_currency?(currency, other_money.currency)
end
def <=>(other_money)
+ other_money = Money.new(other_money) unless other_money.is_a? Money
if bank.same_currency?(currency, other_money.currency)
cents <=> other_money.cents
else
cents <=> other_money.exchange_to(currency).cents
end