title: Rails Date After
body: <p>I need to do a query on Rails model time stamps (<code>created_at</code> and <code>updated_at</code>) finding all records after a specified date. When executing the query:</p>
  
  <pre><code>Item.where("created_at &gt; :date OR updated_at &gt; :date", date: "2011-05-29")
  &gt; SELECT "items".* FROM "items" WHERE (created_at &gt; '2011-05-29' OR updated_at &gt; '2011-05-29')
  </code></pre>
  
  <p>It includes records like:</p>
  
  <pre><code>attributes: 
    created_at: 2011-05-29 16:07:10.664227
    updated_at: 2011-05-29 16:07:10.664229
  </code></pre>
  
  <p>However, this date isn't greater than the one specified. Any simple way to fix this query? Thanks.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I've also tried doing:</p>
  
  <pre><code>Item.where("created_at &gt; :date OR updated_at &gt; :date", date: "2011-05-29 16:07:10")
  </code></pre>
  
  <p>With the same result, however adding the fraction of seconds stamp as well gives the correct result.</p>