-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
CHANGELOG for JSON refactor + added back the encode_big_decimal_as_string
option with warning
#13060
CHANGELOG for JSON refactor + added back the encode_big_decimal_as_string
option with warning
#13060
Conversation
"The JSON encoder in Rails 4.1 no longer supports encoding BigDecimals as JSON numbers. " \ | ||
"If your application depends on this, you should install the 'activesupport-json_encoder' " \ | ||
"gem to restore the old behavior. In the future, the related configuration option, " \ | ||
"ActiveSupport.encode_big_decimal_as_string, will be removd from Rails." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, also changed "install the xxx gem" => "add the xxx gem to your Gemfile"
Updated with the suggestions from @carlosantoniodasilva. I kept the changelog entry in its original position when rebasing, partly because that's the order we merged these commits, and partly because I don't have to compete with future additions to the changelog :) |
def encode_big_decimal_as_string=(as_string) | ||
message = \ | ||
"The JSON encoder in Rails 4.1 no longer supports encoding BigDecimals as JSON numbers. Instead, " \ | ||
"the new enocder will always encode them as strings.\n\n" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encoder
(in both messages)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
"the new encoder will always encode them as strings.\n\n" \ | ||
"You are seeing this error because you are trying to check the value of the related configuration, " \ | ||
"'active_support.encode_big_decimal_as_string'. For now, this option will always be true. In the " \ | ||
"future, it will be removed from Rails, so you should stop checking its value." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be interesting to talk about the gem here too? If people are checking this, they might have a reason for doing so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated
"The JSON encoder in Rails 4.1 no longer supports encoding BigDecimals as JSON numbers. Instead, " \ | ||
"the new encoder will always encode them as strings.\n\n" \ | ||
"You are seeing this error because you are trying to check the value of the related configuration, " \ | ||
"'active_support.encode_big_decimal_as_string'. If your application depend on this option, you should " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your application depends
Minor comment, I think we're good to |
Also added the missing CHANGELOG entry for rails#12183 @ 80e7552 and 4d02296.
@carlosantoniodasilva Fixed 👍 |
CHANGELOG for JSON refactor + added back the `encode_big_decimal_as_string` option with warning
Thanks ❤️ |
😁 |
/cc @jeremy