I have few typical models:
class Team < AR::Base
class Game < AR::Base
When I list the team.games I want to be able to aggregate some of the
data (games won, lost etc). I could do this using scopes, but there are
so many different calculations it would result in a lot of queries.
As I am already fetching all the team games in one DB call, should I be
doing the calculations using just plain ruby on the fly, or even on the
client side using JSON/JS? Or is it better in fact to push everything
I'm not sure of the best plan of attack to do these calculations given
that they could well involve pulling data from the children of each game
as well (e.g events).
Many thanks in advance for any insight. I am pulling my hair out here!