rails/rails — pull request #6156 by mjtko (2012-05-04 15:05:38+00:00)
Title: Beginning and end of hour support for Time and DateTime

This feature was initially proposed in #598.

This pull request consists of implementations and test coverage fro #beginning_of_hour and #end_of_hour methods for Time and DateTime core extensions within activesupport. No implementation has been provided for Date (beginning_of_hour and end_of_hour for a Date seems nonsensical).

While this feature has been based on master, I'm more than happy to submit it against 3-2-stable for any future 3.2.x release.

For anybody wanting to monkey patch their existing Rails applications with this code, take this gist and place in an initializer: https://gist.github.com/2595181