I’m wondering if there’s a way in RoR other than going to raw SQL to
take a table of scores, group and sum them by each user, then average
those values?
On Jun 24, 9:50 am, Bob W. [email protected] wrote:
I think you can use named_scope for last_week and this_week, and
has_many relationships between user and the gamepoint, so that will
give you user.gamepoints.last_week and user.gamepoints.this_week.
Then you can use collect to get the point values and do the sum and
average.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.