title: How to check if value unique for a certain period
body: <p>I have a Ratings model with a phone_id attribute. Before creating a new ratings object I want to check if the phone_id is unique for the past week.</p>
  
  <p>In my model I want to do something like this in the before_save callback:</p>
  
  <pre><code>self.all(:conditions =&gt; {:created_at =&gt; (1.week.ago..Date.today)}).include? self.phone_id
  </code></pre>