Full review (do not merge)

This (and the above) method creates excessive amount of queries when user hits the dashboard. Use SQL (ActiveRecord) aggregate and group functions to do the same result.