title: Calling class/instance method in controller
body: <p>I just started putting together an app thats a skills matrix for employees. </p>
  
  <p>Each employee has 3 ratings. One from themselves, one from their manager, and one from an expert in the skill. </p>
  
  <p>I want to have each employee have a weighted score based upon the above 3 scores with respective weights (40%, 20%, 40%). </p>
  
  <p>I assume I need to create some sort of method in my model something like:</p>
  
  <pre><code>def self.calc_weight
    a = Rating.find(params[:id])
    b = a.emp_score *.4
    c = a.mgr_score *.2
    d = a.sme_score *.4
    e = b + c + d
    a.wgt_score = e
  end
  </code></pre>
  
  <p>I know this is improper syntax. Is this the correct approach or should this be something thats handled by my controller after creation of rating? If so on which controller action would i define this? If I'm to utilize a method, I have the same question. I'm sure theres also a better way to do this. </p>