title: Date difference query in ruby/rails
body: <p>I have an Opportunity model that has an attribute called date_of_opportunity. I am trying to write a query where I can find every opportunity whose date is within 30 days of today. My query is:</p>
  
  <pre><code> Opportunity.where("date_of_opportunity - :today &lt; 30", today: Date.today).size
  </code></pre>
  
  <p>My dates for my opportunities are:
  2018-05-06
  2011-04-04
  2009-04-08
  2017-03-06</p>
  
  <p>However when I run the query, it returns all of the dates. Does anyone have any idea what is wrong with my query? Perhaps the "30" is not a unit of days?</p>
  
  <p>Thanks!</p>