Update user finding (by username) in teams_members (project team) controller

This commit is contained in:
Andrey Kumanyaev 2013-01-25 22:34:49 +04:00
parent f225ff8674
commit e1679d20c7

View file

@ -39,7 +39,7 @@ class TeamMembersController < ProjectResourceController
end
def destroy
@user_project_relation = project.users_projects.find_by_user_id(params[:id])
@user_project_relation = project.users_projects.find_by_user_id(member)
@user_project_relation.destroy
respond_to do |format|
@ -59,6 +59,6 @@ class TeamMembersController < ProjectResourceController
protected
def member
@member ||= User.find(params[:id])
@member ||= User.find_by_username(params[:id])
end
end