Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception when options is JSON::Ext #496

Closed
wants to merge 1 commit into from
Closed

Conversation

@svasva
Copy link

svasva commented Jan 27, 2014

No description provided.

@chancancode

This comment has been minimized.

Copy link
Contributor

chancancode commented Jan 27, 2014

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?

@mikegee

This comment has been minimized.

Copy link
Contributor

mikegee commented Jan 28, 2014

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.

@svasva

This comment has been minimized.

Copy link
Author

svasva commented Jan 28, 2014

In my case this was happening when running JRuby. Nothing else is special.

@chancancode

This comment has been minimized.

Copy link
Contributor

chancancode commented Feb 1, 2014

@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))

@steveklabnik

This comment has been minimized.

Copy link
Contributor

steveklabnik commented Jul 28, 2014

I'd like to see this fixed upstream, as this should always be a hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.