BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
61cfd1d2
Unverified
Commit
61cfd1d2
authored
Jun 03, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap group removal into service
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
79aac2c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
3 deletions
+14
-3
groups_controller.rb
app/controllers/admin/groups_controller.rb
+1
-1
groups_controller.rb
app/controllers/groups_controller.rb
+1
-1
destroy_group_service.rb
app/services/destroy_group_service.rb
+11
-0
groups.rb
lib/api/groups.rb
+1
-1
No files found.
app/controllers/admin/groups_controller.rb
View file @
61cfd1d2
...
...
@@ -47,7 +47,7 @@ class Admin::GroupsController < Admin::ApplicationController
end
def
destroy
@group
.
destroy
DestroyGroupService
.
new
(
@group
,
current_user
).
execute
redirect_to
admin_groups_path
,
notice:
'Group was successfully deleted.'
end
...
...
app/controllers/groups_controller.rb
View file @
61cfd1d2
...
...
@@ -82,7 +82,7 @@ class GroupsController < Groups::ApplicationController
end
def
destroy
@group
.
destroy
DestroyGroupService
.
new
(
@group
,
current_user
).
execute
redirect_to
root_path
,
notice:
'Group was removed.'
end
...
...
app/services/destroy_group_service.rb
0 → 100644
View file @
61cfd1d2
class
DestroyGroupService
attr_accessor
:group
,
:current_user
def
initialize
(
group
,
user
)
@group
,
@current_user
=
group
,
user
end
def
execute
@group
.
destroy
end
end
lib/api/groups.rb
View file @
61cfd1d2
...
...
@@ -62,7 +62,7 @@ module API
delete
":id"
do
group
=
find_group
(
params
[
:id
])
authorize!
:admin_group
,
group
group
.
destroy
DestroyGroupService
.
new
(
group
,
current_user
).
execute
end
# Transfer a project to the Group namespace
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment