summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index a4c8f7fc87e..888aa7e77d2 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -266,7 +266,7 @@ module API
authorize! :admin_project, user_project
required_attributes! [:access_level]
- team_member = user_project.users_projects.find_by_user_id(params[:user_id])
+ team_member = user_project.users_projects.find_by(user_id: params[:user_id])
not_found!("User can not be found") if team_member.nil?
if team_member.update_attributes(project_access: params[:access_level])
@@ -286,7 +286,7 @@ module API
# DELETE /projects/:id/members/:user_id
delete ":id/members/:user_id" do
authorize! :admin_project, user_project
- team_member = user_project.users_projects.find_by_user_id(params[:user_id])
+ team_member = user_project.users_projects.find_by(user_id: params[:user_id])
unless team_member.nil?
team_member.destroy
else