lib/monetize.rb in monetize-1.5.0 vs lib/monetize.rb in monetize-1.6.0
- old
+ new
@@ -90,10 +90,11 @@
def self.from_fixnum(value, currency = Money.default_currency)
currency = Money::Currency.wrap(currency)
value *= currency.subunit_to_unit
Money.new(value, currency)
end
+ singleton_class.send(:alias_method, :from_integer, :from_fixnum)
def self.from_float(value, currency = Money.default_currency)
value = BigDecimal.new(value.to_s)
from_bigdecimal(value, currency)
end
@@ -105,10 +106,10 @@
Money.new(value, currency)
end
def self.from_numeric(value, currency = Money.default_currency)
case value
- when Fixnum
+ when Integer
from_fixnum(value, currency)
when Numeric
value = BigDecimal.new(value.to_s)
from_bigdecimal(value, currency)
else