MessagePack might interest you to look at.<div><a href="http://msgpack.org/">http://msgpack.org/</a></div><div><br></div><div>Tatsuya<br><a href="http://twitter.com/ono">twitter.com/ono</a></div><div><br><div class="gmail_quote">
On 14 July 2011 10:31, Olly Legg <span dir="ltr"><<a href="mailto:ollylegg@gmail.com">ollylegg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> 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>
<br>
</div>Rails uses YAML, so its probably not a bad bet.<br>
<div class="im"><br>
> 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>
<br>
</div>Rails used to use Marsahl.dump by default but, as far as I understand it, it's not guaranteed to be readable by future ruby versions. So when people upgraded Ruby they could no longer de-serialize the data they had already stored.<br>
<br>
This prompted switching the default to YAML. However this looks like it wasn't as foolproof as they intended.<br>
<div><div></div><div class="h5">_______________________________________________<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></div>