From f9c2f76bea41c4a7ad1419844c6102211787c458 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 3 Jun 2013 20:08:56 +0200 Subject: The behavior we had in place in rc1 was actually to convert to DateTime and use <=> from there. Restore that. --- activesupport/lib/active_support/core_ext/date/calculations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3