diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-14 03:32:34 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-14 03:32:34 -0800 |
commit | 79a98d82daf3614f7e17b1436005cf3b10e83557 (patch) | |
tree | 70a1f76a5c732f80607d7446681bc630539c6c29 /activesupport/lib | |
parent | 7c62a752db77af1aec57ccd4822e87cd6fd633b6 (diff) | |
parent | b1a501e6fb36e8dd16ceeaa2f9575e762a227a6d (diff) | |
download | rails-79a98d82daf3614f7e17b1436005cf3b10e83557.tar.gz rails-79a98d82daf3614f7e17b1436005cf3b10e83557.tar.bz2 rails-79a98d82daf3614f7e17b1436005cf3b10e83557.zip |
Merge pull request #8927 from dkubb/issue-8178
Fix DateTime comparison with DateTime::Infinity object
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/calculations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_time/calculations.rb b/activesupport/lib/active_support/core_ext/date_time/calculations.rb index b759dcc824..0481bd2195 100644 --- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb @@ -138,6 +138,6 @@ class DateTime # 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 |