In here you'd put the update_score method

def update_score
  updated_score = self.comments.sum(:score)
  self.update_attribute(:score, updated_score)
end