diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-08-07 16:10:20 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-08-07 16:10:20 -0700 |
commit | 089661b69ad055cab68ea860c085c7f852da3972 (patch) | |
tree | a39fe35f3c399b199bdca8490724b451761a1cba /activesupport/lib/active_support/core_ext/date_time/calculations.rb | |
parent | cc1de71bfaced172fe00a66fd381da69d9528e8b (diff) | |
parent | e81453ef92b37156dafc092093106c8e8b87b268 (diff) | |
download | rails-089661b69ad055cab68ea860c085c7f852da3972.tar.gz rails-089661b69ad055cab68ea860c085c7f852da3972.tar.bz2 rails-089661b69ad055cab68ea860c085c7f852da3972.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_time/calculations.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_time/calculations.rb | 4 |
1 files changed, 3 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 289ca12b5e..dc4e767e9d 100644 --- a/activesupport/lib/active_support/core_ext/date_time/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date_time/calculations.rb @@ -161,7 +161,9 @@ class DateTime # Layers additional behavior on DateTime#<=> so that Time and # ActiveSupport::TimeWithZone instances can be compared with a DateTime. def <=>(other) - if other.respond_to? :to_datetime + if other.kind_of?(Infinity) + super + elsif other.respond_to? :to_datetime super other.to_datetime else nil |