summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-28 19:31:17 +0200
committerRémy Coutable <remy@rymai.me>2016-10-03 16:57:48 +0200
commit3158f57dba6dcef3e586ae8fced7deb6fdbd6dc0 (patch)
tree51c000c699b1199f3838c3c46c5ac5dbe16773bd /app/controllers/groups
parent958815a039af68dc68b333b69b3e9e3f3bc4ee2e (diff)
downloadgitlab-ce-3158f57dba6dcef3e586ae8fced7deb6fdbd6dc0.tar.gz
Improve Members::DestroyService
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/group_members_controller.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb
index 9c323d7705a..f9368303d54 100644
--- a/app/controllers/groups/group_members_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -40,10 +40,7 @@ class Groups::GroupMembersController < Groups::ApplicationController
end
def destroy
- @group_member = @group.members.find_by(id: params[:id]) ||
- @group.requesters.find_by(id: params[:id])
-
- Members::DestroyService.new(@group_member, current_user).execute
+ Members::DestroyService.new(@group, current_user, user_id: params[:id]).execute(:all)
respond_to do |format|
format.html { redirect_to group_group_members_path(@group), notice: 'User was successfully removed from group.' }