From b3a5f0a78d1d3e6d6ec3655ca1c936d983b7d69c Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 17 Oct 2012 16:55:08 +0200 Subject: [PATCH] Fix wrong parameter order in Team#team_member_by_name_or_email --- app/roles/team.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/roles/team.rb b/app/roles/team.rb index 8aef405a..a7ba0588 100644 --- a/app/roles/team.rb +++ b/app/roles/team.rb @@ -1,7 +1,7 @@ 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 + def team_member_by_name_or_email(name = nil, email = nil) + user = users.where("name like ? or email like ?", name, email).first + users_projects.where(user: user) if user end # Get Team Member record by user id