Hi Christian, You don't need to marshal the object yourself if you're using the Object property. Just assign any ruby object to it directly. DataMapper will handle the marshalling/unmarshalling.
It's actually saved in the database as base64 encoded marshalled data. Just for reference, however, marshalling/unmarshalling is a simple process in Ruby: data = Marshal.dump(some_object) rebuilt_object = Marshal.load(data) The marshal data isn't human readable. It's packed in a binary form. There are #_dump and #_load (or #marshal_dump and #marshal_load) methods defined on all objects for you to override should you want to change the default marshalling behaviour. Cheers, Chris On 23/09/2011, at 12:15 AM, Chris wrote: > Hi, > > I'd like to save the complete request object in a sqlite db. > > In the documentation I found "Object, (marshalled)" as prooerty, but > as I am new to ruby & sinatra & datamapper I don't know how to marshal > my object and to save it. > > At the moment I use a "Text" property and "request.inspect" to save > the data. But I feel, that's not the way to do. > > Thanks, > > Christian > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/datamapper?hl=en. > -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
