blob: decf099624c8f1590a10a013e35a3e254e8ccd03 (
plain) (
tree)
|
|
require 'active_support/core_ext/date_and_time/with_duration'
module ActiveSupport
module DateOperators # :nodoc:
include DateAndTime::WithDuration
# Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there.
def <=>(other)
if other.is_a?(Time)
self.to_datetime <=> other
else
super
end
end
end
end
|