aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2011-10-03 10:53:09 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2011-10-03 10:53:09 -0700
commitc10fcd26376d9cdc4d4a27b66271ab33413ca18f (patch)
treec60802e88fdc81c145c6f53b1e7310cf76e645dc /activesupport/lib/active_support/core_ext
parente141cbdff5655004e358f0e96fa5b606b02b761a (diff)
parentda8f00a55c55bd4af152150b71823627a55bba5b (diff)
downloadrails-c10fcd26376d9cdc4d4a27b66271ab33413ca18f.tar.gz
rails-c10fcd26376d9cdc4d4a27b66271ab33413ca18f.tar.bz2
rails-c10fcd26376d9cdc4d4a27b66271ab33413ca18f.zip
Merge pull request #2801 from jeremyevans/patch-1
Fix obviously breakage of Time.=== for Time subclasses
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index a15a06d0e4..372dd69212 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -9,7 +9,7 @@ class Time
class << self
# Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances
def ===(other)
- other.is_a?(::Time)
+ super || (self == Time && other.is_a?(ActiveSupport::TimeWithZone))
end
# Return the number of days in the given month.