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

Fix Money gem deprecations #3453

Merged
merged 2 commits into from
Dec 12, 2019

Conversation

kennyadsl
Copy link
Member

Description
This PR fixes a couple of deprecation warnings we are receiving from Money gem.

Money.rounding_mode deprecation, which emits:

[WARNING] The default rounding mode will change to `ROUND_HALF_UP` in the next major release. Set it explicitly using `Money.rounding_mode=` to avoid potential problems.

Money.default_currency deprecation, which emits:

[WARNING] The default currency will change to `nil` in the next major release. Make sure to set it explicitly using `Money.default_currency=` to avoid potential issues

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • [ ] I have added tests to cover this change (if needed)
  • [ ] I have attached screenshots to this PR for visual changes (if needed)

This is the current default value, but it will change in
the Money gem in some future release (v7).

People can start adhering to that value by setting

Money.rounding_mode = BigDecimal::ROUND_HALF_UP

in their own application. For now, this is what we used so far
and we should not change it for existing applications.

Ref: RubyMoney/money#883
Not setting a default currency is deprecated and the default will
be nil in some future version (probably v7).

We are setting the default using the Spree::Config.currency setting
that we already have.
@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Dec 10, 2019
@kennyadsl kennyadsl self-assigned this Dec 10, 2019
Copy link
Contributor

@ericsaupe ericsaupe left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@kennyadsl thanks!

@kennyadsl kennyadsl merged commit 9afaa31 into solidusio:master Dec 12, 2019
@kennyadsl kennyadsl mentioned this pull request Dec 12, 2019
2 tasks
@kennyadsl kennyadsl deleted the kennyadsl/fix-money-deprecations branch December 12, 2019 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants