assemblymade/coderwall — pull request #261 by jakegavin (2014-12-13 21:43:42+00:00)
Title: Bounty #455 - Fix User#on_team?

https://assembly.com/coderwall/bounties/455

Currently the welcome email checks if `@user.on_team?` and then if they are presents some info referencing `@user.team` https://github.com/assemblymade/coderwall/blob/master/app/views/notifier_mailer/welcome_email.html.haml#L20
`User#on_team?` previously checked for `team_document_id`. I talked with @seuros who told me that `team_document_id` is deprecated and will be removed, and that we're temporarily using `team_id` until support for belonging to multiple teams is added.

I've updated `User#on_team?` to check if a user has a `team_id` or a `membership`. I also updated `User#team` so that it returns the team associated with the `membership` (but also still supports associating teams by `team_id`).

This is my first PR on this project and this is one of the larger, more complex projects I've worked on so let me know if there is anything I should be doing differently.