Topic: SUM through associations?

Hello everyone! I just discovered this board, it looks awesome.

I'm a little stumped. I have the following structure:

  • User has_many Tasks

  • Task has_many Assets

  • Asset has a score attribute

I'd like to generate a list of users, with their individual total score across their tasks/assets. I tried using scopes, but they're very new to me. I suspect this might be involve SQL trickery.

Thank you in advance for any help!