title: Ruby on Rails custom search feature
body: <p>I have an attribute Score in my &quot;sheet&quot; model which updates Daily, I want to give user feature that user can search sheets where an average of sheets for the last 5 days is greater than 50 or any other number how can I implement this feature?</p>
  <p>eg.- score average for last 10 days &gt; 40,</p>
  <pre><code> score average for  last 30 days &gt; 60
  </code></pre>