Serializing / deserializing active records with children

What is the best approach to serialize / deserialize full blown active
record objects with multiple child objects (one-to-many relations).

YAML::load(), YAML::dump() almost work :slight_smile: -> loaded object has
children (I see them in breakpoint session: “puts parent”), but when I
am accessing children (e.g: “puts parent.emails”) array becomes
cleared - I guess rails are trying to hit db to get children, but
those are only in yaml.

Perhaps there is somewhere method opposite to to_xml() ?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs