flori/json — pull request #195 by shepmaster (2014-01-08 15:50:19+00:00)
Title: Call `to_json` on the object to allow overridden methods the first shot

ActiveSupport will call `merge` on the GeneratorState, which resets
the depth back to 0. Then we decrement it again and pass that negative
value to System.arraycopy, which throws an exception.

This fixes the problem in the same way as the pure JSON code: it calls
`to_json` on the passed-in object. This method is implemented /
overridden by ActiveSupport, which then ignores the pretty-printing
completely.