Skip to content

Ensure floats are correctly coerced to bigdecimal #2033

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

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

tlconnor
Copy link

Possible fix for Float coercion to BigDecimal #2032.

When checking for equality of params, checks both the class and value of params rather than just the value.

/cc: @dblock @dnesteryuk

@tlconnor tlconnor force-pushed the fixBigDecimalCoercion branch from 527ed52 to b3616b2 Compare March 31, 2020 19:54
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Looks like there are legit failures depending on Rails version.

CHANGELOG.md Outdated
@@ -10,6 +10,7 @@
#### Fixes

* Your contribution here.
* [#2033](https://github.com/ruby-grape/grape/pull/2033): Ensure floats are correctly coerced to bigdecimal - [@tlconnor](https://github.com/tlconnor).
Copy link
Member

Choose a reason for hiding this comment

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

quote and spell Float and BigDecimal

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@tlconnor tlconnor force-pushed the fixBigDecimalCoercion branch from b3616b2 to 4a52bea Compare March 31, 2020 23:12
@dblock dblock merged commit a56fb88 into ruby-grape:master Apr 1, 2020
@dblock
Copy link
Member

dblock commented Apr 1, 2020

👍

@tlconnor tlconnor deleted the fixBigDecimalCoercion branch April 1, 2020 05:13
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.

2 participants