ActiveSupport JSON encoding, default JSON gem and SystemStackError #368

Closed
jayeff opened this Issue Mar 19, 2013 · 5 comments

Projects

None yet

3 participants

@jayeff

Hi,

after I updated to v4.6.1 I can no longer encode a Tweet to JSON with as_json / to_json. When I try to encode the tweet with a user I get a SystemStackError: stack level too deep.

Here's a gist: https://gist.github.com/jayeff/5196230 / this problem still exists on current HEAD
I'm running ruby 1.9.3-p374, OS X 10.8.2

I dug a bit into this. Bisecting says that it stopped working with ff4f2da. The problem is that when I encode the tweet, this encodes the referenced User, who references the tweet (user.status), this tweet again references the User, etc.
#364 discusses this as well. Both changes do not solve the describe problem.

@purcell purcell referenced this issue in intridea/multi_json Mar 19, 2013
Closed

1.7.1: Breakage with ActiveRecord serialization #101

@purcell

Yep, seeing this as well.

@sferik
Owner

Thanks for reporting this. I'll revert ff4f2da and release a new version of the gem.

@sferik sferik closed this Mar 19, 2013
@sferik
Owner

Released version 4.6.2, which should resolve this issue.

@jayeff

It did. Thanks.

@purcell

@sferik Thanks from me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment