diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-13 18:28:33 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-15 15:52:28 +0300 |
commit | 84371de01f3ce7bab334539a93734658528736ec (patch) | |
tree | 25f7a74f039d60c2a3e377d12d45876419ae3829 /app/controllers/dashboard/groups_controller.rb | |
parent | 224187ffb96283cbf42953a30c116931c03562a2 (diff) |
Move group leave action from dashboard/groups to groups/group_members.
Diffstat (limited to 'app/controllers/dashboard/groups_controller.rb')
-rw-r--r-- | app/controllers/dashboard/groups_controller.rb | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/app/controllers/dashboard/groups_controller.rb b/app/controllers/dashboard/groups_controller.rb index b827639978c..ed14f4e1f3b 100644 --- a/app/controllers/dashboard/groups_controller.rb +++ b/app/controllers/dashboard/groups_controller.rb @@ -1,21 +1,5 @@ class Dashboard::GroupsController < ApplicationController def index - @user_groups = current_user.group_members.page(params[:page]).per(PER_PAGE) - end - - def leave - @users_group = group.group_members.where(user_id: current_user.id).first - if can?(current_user, :destroy, @users_group) - @users_group.destroy - redirect_to(dashboard_groups_path, info: "You left #{group.name} group.") - else - return render_403 - end - end - - private - - def group - @group ||= Group.find_by(path: params[:id]) + @group_members = current_user.group_members.page(params[:page]).per(PER_PAGE) end end |