title: Date/Time comparison in Rails
body: <p>I want to be able to compare Dates and Times in Rails without always having to call the to_time or to_date method. So I wrote the following code:</p>
  
  <pre><code>class Date
    def ==(other)
      if other.kind_of?(Time)
        self.to_time == other
      else
        super(other)
      end
    end
  end
  </code></pre>
  
  <p>I know there's an easy way to write this so that I can make this work for >, &lt;, >=, &lt;= and &lt;=>. But I forgot how :P Any ideas?</p>