No description provided.
Fix exception when options is JSON::Ext
Under normal use you shouldn't be fed that – this might be a bug in Rails itself. What version of Rails are you using, and can you post the code that causes this?
This is the right way to make sure options is a Hash. I think its a good change even if Rails always sends a Hash. This gem should strive to be decoupled from Rails where possible.
In my case this was happening when running JRuby. Nothing else is special.
@erundook Are you doing something like JSON.dump(MySerializer.new(....)) by any chance? (Maybe indirectly, through a gem?)
@mikegee as_json itself is actually a Rails-specific hook. If options is not a hash, it's probably being called by some incompatible implementations (you can read about the details at intridea/multi_json#138 (comment))
I'd like to see this fixed upstream, as this should always be a hash.