mutations
mutations copied to clipboard
Provide support for BigDecimal use with float_filter
I ran into issues in my tests where I used model.attributes to provide my inputs (e.g. for updates) where I am storing values as BigDecimal instead of Float.
Using Numeric
instead of Fixnum
should still work well with .to_f
but will include support for BigDecimal
as input.
All tests pass so I don't think I have gone against some intended behaviour. Let me know if you have any questions?
The error here looks like a Travis CI rvm configuration issue rather than an issue with the code committed.
Accepting BigDecimal inputs sounds reasonable 👍
It looks like there are other changes on your branch now though - do you want to remove them so I can merge this pull request, or would you prefer that I cherry-pick the BigDecimal commit manually?
I will edit the PR to have a dedicated branch for the Numeric change. If I think any of the other changes I have made for my own projects will be useful I will open in separate PRs.