[LRUG] Fixing Time marshalling

Matthew Rudy Jacobs matthewrudyjacobs at gmail.com
Fri Jul 29 04:41:44 PDT 2011


I don't know about pushing rails core to release your code
(For the last couple of years their workload has been too big to cope)

The best place to ask would be the rails-core mailing list.

But generally I include these sorts of hacks in initializers.

config/initializers/time-marshalling.rb

I'd include a comment as to when and why you did it
and at the same time copy over the test from the rails code.

Hopefully at some later point you can remove the initializer, and if the
test passes, you should be good to go.


On 29 July 2011 09:19, David Waller <david.a.waller at btinternet.com> wrote:

> 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
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20110729/6c3d605b/attachment.html>


More information about the Chat mailing list