Skip to content
Browse files

Fix DateTime comparison with DateTime::Infinity object

  • Loading branch information...
1 parent 7c62a75 commit 688d52933a2e611175f3d41c016cf0ba71450b17 @dkubb dkubb committed Jan 13, 2013
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

0 comments on commit 688d529

Please sign in to comment.
Something went wrong with that request. Please try again.