rails/rails — pull request #6096 by hasclass (2012-05-01 04:59:33+00:00)
Title: JSON: encode BigDecimal NaN/Infinity as null.

This is an addendum to https://github.com/rails/rails/pull/2532

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

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