rails/rails — pull request #11742 by gzohari (2013-08-03 19:14:03+00:00)
Title: Remove duplication from time/date-time/date

Move multiple date/time calculations into DateAndTime::Calculations module.
Time and DateTime implementations of the following methods are mostly
identical, Date's implementations are a bit different and are differentiated in
DateAndTime by :acts_like?.
Methods moved (or slightly changed):
:ago, :beginning_of_day, :middle_of_day, :advance(also some logic is moved into private
method), :seconds_until_end_of_day, :beginning_of_hour, :beginning_of_minute.

I am aware there might be a few too many 'ducks' in the calculations module now, probably signaling a missing abstraction. However, if so, I think that should be left to another PR.

/cc @pixeltrix