From 4a643f686afc3c8d0d3d9773e418cf9aed670107 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Sun, 17 Feb 2008 00:35:49 +0000 Subject: Adding TimeWithZone#between? git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/time_with_zone.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/time_with_zone.rb') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 377eee949f..cd4ea8c532 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -125,6 +125,10 @@ module ActiveSupport utc <=> other end + def between?(min, max) + utc.between?(min, max) + end + def eql?(other) utc == other end @@ -160,7 +164,7 @@ module ActiveSupport alias_method :hash, :to_i alias_method :tv_sec, :to_i - # A TimeProxy acts like a Time, so just return self + # A TimeWithZone acts like a Time, so just return self def to_time self end -- cgit v1.2.3