Skip to content

Releases: Shopify/money

v3.0.0

30 Aug 13:28
ca8e590
Compare
Choose a tag to compare

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

Full Changelog: v2.2.2...v3.0.0

v2.2.1

25 Apr 16:48
dfffcd5
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.2.0...v2.2.1

v2.2.0

18 Apr 13:02
4076656
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.1.0...v2.2.0

v2.1.0

08 Apr 17:44
5c32a36
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.0.0...v2.1.0

v2.0.0

30 Jan 18:04
c2dcd72
Compare
Choose a tag to compare

New Major Release 🎉

This is a major release because it introduces significant breaking changes to the API.

What's Changed

Full Changelog: v1.3.0...v2.0.0

Breaking Change

  • You cannot call Money.new to initialize a Money object with another Money object.
    • Example: Money.new(Money.new(5, "USD"), "CAD) will no longer work
    • More details on the rationale in #279
  • You cannot multiply Money objects by other Money objects.
    • Example: Money.new(5, "USD") * Money.new(10, "USD")
    • This was dropped because support for this was deprecated 3 years ago, and continuing to support it adds unnecessary complexity for deprecated behavior.

v1.3.0

09 Aug 17:39
fbca202
Compare
Choose a tag to compare

What's Changed

  • Fix UnsafeToMoney for receiver-less calls by @pjambet in #268
  • 🚚 Rename the master branch to main by @fdelache in #270
  • Allow splat arg in Money/MissingCurrency cop by @sambostock in #256
  • update to_money to have the same behaviour as Money.new by @elfassy in #267

Full Changelog: v1.2.1...v1.3.0

New Contributors

Breaking Change

Those using to_money to parse strings with thousands separators (ex: "1,234") and that do not use the legacy_deprecations configuration are affected by this breaking change. You can choose to revert to the old behaviour by using Money::Parser::Fuzzy.parse instead of using to_money. Ideally you should parse thousand separators on the frontend using the user's locale instead of doing the parsing on the backend.

v1.2.1

20 Jun 18:27
b35448a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.2.0...v1.2.1

v1.2.0

20 Jun 18:16
fe15813
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.2...v1.2.0

v1.1.2

24 Jan 21:54
Compare
Choose a tag to compare
  • Support 2 decimals for UGX currency in :stripe format (#258)

v1.1.1

24 Jan 14:05
2c47ee5
Compare
Choose a tag to compare
  • Improve performance of Money#to_fs (#254)