mutations icon indicating copy to clipboard operation
mutations copied to clipboard

Provide support for BigDecimal use with float_filter

Open tyronewilson opened this issue 7 years ago • 3 comments

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?

tyronewilson avatar Jan 11 '17 09:01 tyronewilson

The error here looks like a Travis CI rvm configuration issue rather than an issue with the code committed.

tyronewilson avatar Jan 11 '17 10:01 tyronewilson

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?

eugeneius avatar Oct 24 '18 21:10 eugeneius

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.

tyronewilson avatar Oct 25 '18 06:10 tyronewilson