instance method
<=>
Ruby on Rails 8.1.2
Since v3.0.20Signature
<=>(other)
Layers additional behavior on DateTime#<=> so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime.
Parameters
-
otherreq
Source
# File activesupport/lib/active_support/core_ext/date_time/calculations.rb, line 208
def <=>(other)
if other.respond_to? :to_datetime
super other.to_datetime rescue nil
else
super
end
end
Defined in activesupport/lib/active_support/core_ext/date_time/calculations.rb line 208
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateTime