Skip to content

Breaks rails to_json #2

Closed
abhishiv opened this Issue Apr 2, 2012 · 7 comments

3 participants

@abhishiv
abhishiv commented Apr 2, 2012

Tested with rails 3.2.2 and 3.2.3, although old version should be affected as well.

Probably it's because of the override of Hash#require_keys!

@jage
Owner
jage commented Apr 2, 2012

I've removed Hash#require_keys! and pushed a new gem.
I couldn't reproduce this, could you please confirm that it's working now? (I agree that it's a probable cause)

Thank you for reporting this!

@abhishiv

hey

just checked it after a long time, and it's still misbhevaing

irb(main):008:0> Message.last.to_json
=> "\"#<Message:0x007ffe3c8eeeb8>\""

Happens just by including elk in my Gemfile, are you not encountering this?

Using rails 3.2.3, btw.

@teoulas
teoulas commented May 2, 2012

I have the same problem when trying to serialize an AR model to json

@abhishiv
abhishiv commented May 3, 2012

Ok, got curious and looks like it might be because of json_pure - flori/json#33

@jage
Owner
jage commented May 3, 2012

What do you guys think of multi_json?
Looks like the least intrusive way to get "good" json support.

I've pushed some code to a multi_json-branch, I'll try to do some more extensive testing with Rails 3.2.3 in a few days, and then push a new gem.

@abhishiv
abhishiv commented May 4, 2012

Just tested and it works perfectly with multi_json. Thanks :)

@jage
Owner
jage commented May 4, 2012

Gem pushed!

@jage jage closed this May 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.