Skip to content
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

Merged

Conversation

chancancode
Copy link
Member

/cc @jeremy

"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."
Copy link
Member

Choose a reason for hiding this comment

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

removed

Copy link
Member Author

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"

@chancancode
Copy link
Member Author

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" \

Choose a reason for hiding this comment

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

encoder (in both messages)

Copy link
Member Author

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."

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?

Copy link
Member Author

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 " \

Choose a reason for hiding this comment

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

If your application depends

@carlosantoniodasilva
Copy link
Member

Minor comment, I think we're good to :shipit:

@chancancode
Copy link
Member Author

@carlosantoniodasilva Fixed 👍

carlosantoniodasilva added a commit that referenced this pull request Dec 3, 2013
CHANGELOG for JSON refactor + added back the `encode_big_decimal_as_string` option with warning
@carlosantoniodasilva carlosantoniodasilva merged commit 6e905e2 into rails:master Dec 3, 2013
@carlosantoniodasilva
Copy link
Member

Thanks ❤️

@chancancode
Copy link
Member Author

😁

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.

None yet

3 participants