I need to serialize a composite AR model and save it to a database field. Reading up on Ruby''s Marshaling, it seems there could be problems with the version numbering thing of the default dump/load methods. As I understand it, Ruby internally marks the serialized data with the current Ruby language version, and when loading that data, if the major version is changed, the loading is aborted. Seems like a rather extreme measure compared to testing a version or formatting of the serialized data itself rather than the language version. Or have I read this wrong, and these version numbers are for the marshaling format and not the whole language? Considering 1.9 is not too far away (from an application life-cycle perspective), this would seem to be a potential big problem. Is my only option to create custom marshaling methods? That would seem to be a rather tedious thing to do for a complex composite ActiveRecord object. -- gw --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On May 13, 2008, at 11:47 AM, Greg Willits wrote:> As I understand it, Ruby internally marks the serialized data with > the current Ruby language version, and when loading that data, if the > major version is changed, the loading is aborted. Seems like a rather > extreme measure compared to testing a version or formatting of the > serialized data itself rather than the language version. Or have I > read this wrong, and these version numbers are for the marshaling > format and not the whole language?DOH! I just now saw one short, buried sentence that clarified that marshal versioning is separate from the language versioning. Question answered. -- gw --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---