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

JSON: encode BigDecimal NaN/Infinity as null. #6096

Conversation

hasclass
Copy link
Contributor

@hasclass hasclass commented May 1, 2012

This is an addendum to #2532

Adds the same to_json behaviour to BigDecimal NaN and +/-Infinity.

  {'nan' => BigDecimal(0.0)/(0.0) }.to_json
  # => { 'nan' : null }

@carlosantoniodasilva
Copy link
Member

@drogus I think you've merged the other patch he refers to, could you take a look at this as well?

@drogus
Copy link
Member

drogus commented May 1, 2012

@carlosantoniodasilva sure, it looks ok :)

drogus added a commit that referenced this pull request May 1, 2012
…an_bigdecimals_as_null

JSON: encode BigDecimal NaN/Infinity as null.
@drogus drogus merged commit ec94d84 into rails:master May 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants