diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-06-03 20:08:56 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-06-03 20:09:21 +0200 |
commit | f9c2f76bea41c4a7ad1419844c6102211787c458 (patch) | |
tree | ebc0bddb5a8d16b0803d0cd776ec8f211a0b985d /activesupport/lib/active_support | |
parent | a6fe33d8a3c09f3a70ee2a79f96ed5b2c9580d4f (diff) | |
download | rails-f9c2f76bea41c4a7ad1419844c6102211787c458.tar.gz rails-f9c2f76bea41c4a7ad1419844c6102211787c458.tar.bz2 rails-f9c2f76bea41c4a7ad1419844c6102211787c458.zip |
The behavior we had in place in rc1 was actually to convert to DateTime and use <=> from there. Restore that.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date/calculations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index c7e8b6ae25..06e4847e82 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -120,10 +120,10 @@ class Date ) end - # Allow Dates to be compared with times. The Date will have its time set to 00:00:00 for the comparison. + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. def compare_with_coercion(other) if other.is_a?(Time) - self.to_time <=> other + self.to_datetime <=> other else compare_without_coercion(other) end |