rails/rails — pull request #16001 by johnpaulashenfelter (2014-07-01 13:50:44+00:00)
Title: DateTime#to_f preserves fractional seconds

In Issue GH#15994, @xjlu points out that the to_f method strips the fractional seconds from the DateTime and always returns .0. [https://github.com/rails/rails/issues/15994]

Since @jeremy asked for a pull request with tests, here is the fix with tests.

I am wondering about a flag to preserve the current behavior. It would seem weird someone would count on the fractional value always being .0, but could do something like

to_f(preserve_usec=false) and then switch the implementation, but that seems like overkill to me