Hi,<br><br>I do not know if you use Ruby or Rails, but for instance ActiveRecord uses serialize method, which is YAML stored in  the DB:<br><br><pre>class User < ActiveRecord::Base
  serialize :preferences
end</pre><br><br><div class="gmail_quote">On 14 July 2011 11:19, Jonathan del Strother <span dir="ltr"><<a href="mailto:maillist@steelskies.com">maillist@steelskies.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Marshal.dump would be the obvious choice.  Just make sure you're<br>
either storing it as binary or converting to base64 first, to avoid<br>
interesting encoding/decoding problems in mysql.<br>
<div><div></div><div class="h5"><br>
On 14 July 2011 10:11, Andrew Stewart <<a href="mailto:boss@airbladesoftware.com">boss@airbladesoftware.com</a>> wrote:<br>
> Hola El Rug,<br>
><br>
> What's the best way these days to serialise a Ruby object for storage in a SQL database field, and de-serialise it back again?<br>
><br>
> To date I've been using YAML but I've run across a situation where the YAML written by Ruby can't be de-serialised again (due, I think, to Sych versus Psych).<br>
><br>
> Should I be switching to something other than YAML?<br>
><br>
> Cheers,<br>
> Andy Stewart<br>
><br>
> -------<br>
> <a href="http://airbladesoftware.com" target="_blank">http://airbladesoftware.com</a><br>
> _______________________________________________<br>
> Chat mailing list<br>
> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
> <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Riccardo Tacconi<br>Ruby on Rails and PHP development - System Administration<br>VIRTUELOGIC LIMITED<br><br><a href="http://github.com/rtacconi" target="_blank">http://github.com/rtacconi</a><br>
<a href="http://riccardotacconi.blogspot.com" target="_blank">http://riccardotacconi.blogspot.com</a><br><a href="http://twitter.com/rtacconi" target="_blank">http://twitter.com/rtacconi</a><br><a href="http://www.linkedin.com/in/riccardotacconi" target="_blank">http://www.linkedin.com/in/riccardotacconi</a><br>