-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Oj.optimize_rails breaks JSON.load - creates BigDecimal instead of Float #914
Comments
It sounds like the |
Thank you. Running Is this something that should be done automatically by |
There might be. I'll dig into it a bit more tonight. I'm not sure what the default is for rails and json. Does your environment change any defaults that might effect the processing and if so that would they be called? |
I ran into an issue in my application after adding the
oj
gem. I tracked it down tooj
turning some numeric values intoBigDecimal
objects when parsing them. Withoutoj
, they are read as aFloat
object.Rails version: 6.1.7.6
Ruby version: 3.0
The particular issue I'm seeing happens when using
JSON
as the encoder forActiveRecord::Store
: https://api.rubyonrails.org/v6.1/classes/ActiveRecord/Store.htmlThe text was updated successfully, but these errors were encountered: