class DateTime

def <=>(other)

ActiveSupport::TimeWithZone instances can be compared with a DateTime.
Layers additional behavior on DateTime#<=> so that Time and
def <=>(other)
  if other.kind_of?(Infinity)
    super
  elsif other.respond_to? :to_datetime
    super other.to_datetime
  else
    nil
  end
end