rails/rails — pull request #9126 by mbarb0sa (2013-01-30 22:54:07+00:00)
Title: fixed failing JSON decoding in rails 3-0-stable

This change fixes a JSON decoding problem for strings, fixnums and nil objects introduced by 3.0.20.

```ruby
ActiveSupport::JSON.decode(ActiveSupport::JSON.encode("foobar"))
ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(42))
ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(nil))
```

All 3 cases resulted in an ActiveSupport::OkJson::Error being raised.

I've submitted a pull request for Rails 2.3.16 as well. See https://github.com/rails/rails/pull/9107