epicodus/chicktech — pull request #11 by dustinbrownman (2013-11-16 06:31:57+00:00)
Title: User events and jobs through leadership roles

A couple of major changes:

* Added associations called `event_leads` and `team_leads` to the User model that will retrieve all the events and teams the user is leading respectively.

* Added a `uniq: true` option on the has_many associations with events and teams through workable. This allows us to call `user#events` and `user#teams` and get unique results without needing our own methods.

* Also added methods `user#all_events` and `user#all_teams` that will retrieve all the events and teams associated with the user through both jobs and leadership roles (thanks whoever wrote those first has_many associations as it made it easy for me to add this).

Let me know what you think, especially about the `*_leads` associations. Cheers!