diff options
author | Geoff Buesing <gbuesing@gmail.com> | 2008-02-17 00:35:49 +0000 |
---|---|---|
committer | Geoff Buesing <gbuesing@gmail.com> | 2008-02-17 00:35:49 +0000 |
commit | 4a643f686afc3c8d0d3d9773e418cf9aed670107 (patch) | |
tree | 15e2e7a0644a22ebb9c3d9b43ce2e9511c024a5b /activesupport/lib | |
parent | 25e139e545f11c7764abe250f8f33d58874516d7 (diff) | |
download | rails-4a643f686afc3c8d0d3d9773e418cf9aed670107.tar.gz rails-4a643f686afc3c8d0d3d9773e418cf9aed670107.tar.bz2 rails-4a643f686afc3c8d0d3d9773e418cf9aed670107.zip |
Adding TimeWithZone#between?
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |