From 6e84d82ce95a09f80f431b6c0a70900f9cb6a3da Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 21 Feb 2005 15:05:32 +0000 Subject: Make it possible to say Time.now.in(1.year) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time/calculations.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/time') diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 3ebfa125be..6744930756 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -35,6 +35,7 @@ module ActiveSupport #:nodoc: def since(seconds) seconds.since(self) end + alias :in :since # Returns a new Time representing the time a number of specified months ago def months_ago(months) @@ -62,7 +63,7 @@ module ActiveSupport #:nodoc: def next_month months_since(1) end - + # Returns a new Time representing the "start" of this week (Monday, 0:00) def beginning_of_week (self - self.wday.days).midnight + 1.day -- cgit v1.2.3