[LRUG] Fixing Time marshalling

David Waller david.a.waller at btinternet.com
Fri Jul 29 01:19:21 PDT 2011


Hello LRUG,

I've tripped over a bug in Rails 3.0.9, where fractional seconds aren't 
preserved when marshalling-unmarshalling a Time object.  (Hence breaking Times 
that I stored in a session.)  This bug has already been fixed [1] but despite 
that fix having been made in April, it wasn't included in Rails 3.0.9 when that 
was released in June.  


For now I've solved my own problem by copying the relevant part of the 
ActiveSupport time/marshal.rb into my config/application.rb, so overriding the 
Rails override with a fixed version.  That's okay for me, but is there a thing I 
should be doing to ensure that this fix makes it into Rails 3.0.10, and so 
doesn't affect anyone else?  (And allows me to remove the ugly hack from my 
application.rb.)  Or do I just trust that the powers behind Rails have already 
considered this and decided not to?

Thanks,

David

[1] 
https://github.com/rails/rails/commit/96546bb63bd5f1b24f5126e7a3314580bc59584f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20110729/6ff24fd1/attachment-0003.html>


More information about the Chat mailing list