rails/rails — pull request #9295 by lucasmazza (2013-02-15 00:27:53+00:00)
Title: Attempt to convert `as_json` options to a Hash

This avoid errors when serializing models with `JSON.generate`,
where the given option isn't a Hash but a State object, where
a `NoMethodError: undefined method `key?' for JSON::Ext::Generator::State`
error would appear.

/cc @rafaelfranca