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

Rails 3.2.12 breaks to_yaml for dependent active record objects #9263

Closed
clausd opened this issue Feb 12, 2013 · 8 comments
Closed

Rails 3.2.12 breaks to_yaml for dependent active record objects #9263

clausd opened this issue Feb 12, 2013 · 8 comments

Comments

@clausd
Copy link

clausd commented Feb 12, 2013

Due to v3.2.11...v3.2.12#L11R54 serialization of dependent active record objects using yaml seems to fail.

Arel::Nodes::SqlLiteral hides String.count, which breaks the serialization in the same fashion reported here rails/arel#149

Where I've encountered this a workaround has been to load the affected record with find, instead of by traversing a relation, i.e.

Child.find(parent.child_id) instead of parent.child

@steveklabnik
Copy link
Member

/cc @tenderlove @jonleighton

@joho
Copy link
Contributor

joho commented Feb 25, 2013

@tenderlove this is the bug I was bugging you in the bar at rubyconfau about :)

I've got a test that fails within our application which I've gisted up at https://gist.github.com/joho/5d3225cd6c0608d39921

I'm happy to convert it to a proper rails test if someone wants to point me to where they think that test belongs.

@MacksMind
Copy link
Contributor

@clausd Is this fixed by #9292?

@joho
Copy link
Contributor

joho commented Mar 25, 2013

I just pulled down 3-2-stable into our app and re-run the test case I had above and it fixes it for me.

@carlosantoniodasilva
Copy link
Member

Thanks @joho. I'm giving this a close, please anyone let us know if you still find this is a bug in 3-2 or master.

@steveklabnik
Copy link
Member

Cool. 👍. @clausd if you see something different please let me know.

@steveklabnik steveklabnik reopened this Mar 25, 2013
@steveklabnik
Copy link
Member

ahahahahha github

@carlosantoniodasilva
Copy link
Member

😄

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

No branches or pull requests

5 participants