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

Merged
merged 1 commit into from May 1, 2012

3 participants

@hasclass

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
Ruby on Rails member

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

@drogus
Ruby on Rails member

@carlosantoniodasilva sure, it looks ok :)

@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