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.respond_to? :to_datetime
    super other.to_datetime rescue nil
  else
    super
  end
end