Fix exception when options is JSON::Ext #496

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
@svasva

svasva commented Jan 27, 2014

No description provided.

@chancancode

This comment has been minimized.

Show comment
Hide comment
@chancancode

chancancode Jan 27, 2014

Contributor

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?

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.

Show comment
Hide comment
@mikegee

mikegee Jan 28, 2014

Contributor

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.

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.

Show comment
Hide comment
@svasva

svasva Jan 28, 2014

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

svasva commented Jan 28, 2014

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

@chancancode

This comment has been minimized.

Show comment
Hide comment
@chancancode

chancancode Feb 1, 2014

Contributor

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

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.

Show comment
Hide comment
@steveklabnik

steveklabnik Jul 28, 2014

Contributor

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

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