diff options
Diffstat (limited to 'app/roles/team.rb')
-rw-r--r-- | app/roles/team.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/roles/team.rb b/app/roles/team.rb new file mode 100644 index 00000000000..2a477b6edba --- /dev/null +++ b/app/roles/team.rb @@ -0,0 +1,10 @@ +module Team + def team_member_by_name_or_email(email = nil, name = nil) + user = users.where("email like ? or name like ?", email, name).first + users_projects.find_by_user_id(user.id) if user + end + + def team_member_by_id(user_id) + users_projects.find_by_user_id(user_id) + end +end |