Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix DateTime comparison with DateTime::Infinity object

  • Loading branch information...
commit 688d52933a2e611175f3d41c016cf0ba71450b17 1 parent 7c62a75
@dkubb dkubb authored
View
3  activesupport/CHANGELOG.md
@@ -19,6 +19,9 @@
*Daniele Sluijters*
+* Fix DateTime comparison with DateTime::Infinity object.
+
+ *Dan Kubb*
## Rails 3.2.11 (Jan 8, 2012) ##
View
2  activesupport/lib/active_support/core_ext/date_time/calculations.rb
@@ -138,6 +138,6 @@ def utc_offset
# Layers additional behavior on DateTime#<=> so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime
def <=>(other)
- super other.to_datetime
+ super other.kind_of?(Infinity) ? other : other.to_datetime
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.