diff options
author | Geoff Buesing <gbuesing@gmail.com> | 2008-02-16 23:39:40 +0000 |
---|---|---|
committer | Geoff Buesing <gbuesing@gmail.com> | 2008-02-16 23:39:40 +0000 |
commit | 25e139e545f11c7764abe250f8f33d58874516d7 (patch) | |
tree | aadbd8b19c84cdfed0423cde3b6191eeeb7d88b5 /activesupport/lib | |
parent | e7ebd656b31244c3da5abf45e100c8e976c79d50 (diff) | |
download | rails-25e139e545f11c7764abe250f8f33d58874516d7.tar.gz rails-25e139e545f11c7764abe250f8f33d58874516d7.tar.bz2 rails-25e139e545f11c7764abe250f8f33d58874516d7.zip |
Time.=== returns true for TimeWithZone instances
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/calculations.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb index 7fbfca5b2a..ad260f809b 100644 --- a/activesupport/lib/active_support/core_ext/time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/time/calculations.rb @@ -24,6 +24,11 @@ module ActiveSupport #:nodoc: COMMON_YEAR_DAYS_IN_MONTH = [nil, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] module ClassMethods + # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances + def ===(other) + other.is_a?(::Time) + end + # Return the number of days in the given month. # If no year is specified, it will use the current year. def days_in_month(month, year = now.year) |