diff options
author | Yehuda Katz <wycats@gmail.com> | 2011-11-22 13:01:37 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2011-11-22 13:01:37 -0800 |
commit | a93ee92da2b9ba83e3a3fe0b8d4dd5cac2790f15 (patch) | |
tree | 46a33467eca7a163117ed439c65b02e96248060e /activesupport/lib/active_support/time_with_zone.rb | |
parent | 9b7be78820c5510b2f841dc2197ed3a32ad8dd19 (diff) | |
parent | a4912078c7d345a347f023ef28c0986458bdebf5 (diff) | |
download | rails-a93ee92da2b9ba83e3a3fe0b8d4dd5cac2790f15.tar.gz rails-a93ee92da2b9ba83e3a3fe0b8d4dd5cac2790f15.tar.bz2 rails-a93ee92da2b9ba83e3a3fe0b8d4dd5cac2790f15.zip |
Merge pull request #3725 from marcandre/twz_eql
Fix inconsistencies with Time{WithZone}#{hash,eql?}
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r-- | activesupport/lib/active_support/time_with_zone.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 63279d0e6d..d3adf671a0 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -203,7 +203,11 @@ module ActiveSupport end def eql?(other) - utc == other + utc.eql?(other) + end + + def hash + utc.hash end def +(other) @@ -277,7 +281,6 @@ module ActiveSupport def to_i utc.to_i end - alias_method :hash, :to_i alias_method :tv_sec, :to_i # A TimeWithZone acts like a Time, so just return +self+. |