Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.0.0 #318

Merged
merged 16 commits into from
Aug 30, 2024
Merged

V3.0.0 #318

merged 16 commits into from
Aug 30, 2024

Conversation

elfassy
Copy link
Contributor

@elfassy elfassy commented Jul 19, 2024

Merge the v3 feature branch into master

What's Changed

New Contributors

Full Changelog: v2.2.2...v3

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")

TayKangSheng and others added 14 commits June 27, 2024 15:57
arithmetic raises if unable to coerce to money
…id-strings

remove legacy_deprecation check for invalid strings
to_money parse with Money.new when there is no thousand delimiter
…ey-string

Remove deprecation notice and raise error when strings cannot be parsed by bigdecimal
mocking the version doesn't seem to work, we'll just need to update this test on major revision bumps
when we're not able to make an educated guess on decimal vs thousand separator, default to using the decimal separator for the currency
Copy link
Contributor

@mkorostoff-shopify mkorostoff-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@elfassy elfassy merged commit ca8e590 into main Aug 30, 2024
9 checks passed
@elfassy elfassy deleted the v3 branch August 30, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants