title: dynamic attribute for a rails model
body: <p>I'm wondering what is the best way to achieve what I want :p</p>
  
  <p>I have a model 'ModelA' which has many 'ModelARate'. ModelARate contains a comment or a rate (or both).</p>
  
  <p>I don't want to calculate the average rate each time a ModelA is shown. Because it's not cool for the database (accessing all ModelARate and getting rate ...)
  I need to know also the lowest and the highest rate.</p>
  
  <p>How is the best way to achieve this in rails ? (without using a gem, I need to understand how it actually works)</p>
  
  <p>I was thinking of adding a attribute rate_score in ModelA which is increasing when a ModelARate is created, and a method which return rate_score / modelarates.size
  For the lowest and highest rate, an attribute too ? There is no mechanism that can do this for me in rails ?</p>
  
  <p>Thanks for any help</p>