Rails 3.2.12 breaks to_yaml for dependent active record objects #9263

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

Projects

None yet

5 participants

@clausd

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
Ruby on Rails member
@joho

@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

@clausd Is this fixed by #9292?

@joho

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
Ruby on Rails 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
Ruby on Rails member

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

@steveklabnik steveklabnik reopened this Mar 25, 2013
@steveklabnik
Ruby on Rails member

ahahahahha github

@carlosantoniodasilva
Ruby on Rails member

😄

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