Permalink
Browse files

The behavior we had in place in rc1 was actually to convert to DateTi…

…me and use <=> from there. Restore that.
  • Loading branch information...
1 parent 7f42b37 commit 77ac25c6ca42e52c6c42f5aad112dd51c0b0b14b @dhh dhh committed Jun 3, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/core_ext/date/calculations.rb
@@ -120,10 +120,10 @@ def change(options)
)
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

0 comments on commit 77ac25c

Please sign in to comment.