views:

45

answers:

1

I'm thinking about writing an app with question and answer model. Answer has increment attribute that anyone can change to change the rating value. So if I click up on answer that someone else posted, the answer will show 1 point.

But, how do I/can I, use that to increase the rating of the overall user. In essence it is very similar to Stackoverflow. If you rate my answer up, my user rating goes up. I want the same functionality.

+1  A: 

Wouldn't it simply be a matter of incrementing the user when you increment the answer?

answer.increment(:votes)
user.increment(:rating)
Toby Hede