What's Changed
- arithmetic raises if unable to coerce to money by @elfassy in #314
- remove legacy_deprecation check for invalid strings by @TayKangSheng in #315
- to_money parse with Money.new when there is no thousand delimiter by @elfassy in #309
- convert currency by @elfassy in #311
- "".to_money does not generate a deprecation warning by @elfassy in #308
- init configuration for dependabot by @catwomey in #319
- Remove deprecation notice and raise error when strings cannot be parsed by bigdecimal by @TayKangSheng in #307
- default to the currency for thousand delimiter when unknown by @elfassy in #327
Breaking changes
For apps with the legacy_deprecation
option enabled ONLY (everyone else already has the after behaviour)
# before
your_own_object + Money.new(1)
# after
your_own_object.to_money + Money.new(1)
# before
"1.123".to_money #=> Money.new(1_123)
# after
"1.123".to_money #=> Money.new(1.12)
# before
Money.new("$1.00", "USD") #=> Money.new(0, "USD")
Money.new("1,000.00", "USD") #=> Money.new(0, "USD")
# After
Money.new("$1.00", "USD") #=> ArgumentError invalid value for BigDecimal(): "$1.00"
Money.new("1,000.00", "USD") #=> ArgumentError invalid value for BigDecimal(): "1,000.00"
For all apps
# before
Money::Parser::Fuzzy.parse("1.234", "USD") #=> Money.new(1_234, "USD")
Money::Parser::Fuzzy.parse("1.234", "JPY") #=> Money.new(1_234, "JPY")
# After
Money::Parser::Fuzzy.parse("1.234", "USD") #=> Money.new(1.23, "USD")
Money::Parser::Fuzzy.parse("1.234", "JPY") #=> Money.new(1, "JPY")
New Contributors
- @dependabot made their first contribution in #303
- @TayKangSheng made their first contribution in #315
- @catwomey made their first contribution in #319
Full Changelog: v2.2.2...v3.0.0