summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-03-16 19:44:33 -0300
committerFelipe Artur <felipefac@gmail.com>2016-03-16 19:44:33 -0300
commitec20fdf366843e60ed30abb5322c3c1b8f471b4a (patch)
treefd33118e0af74924bcb20a1696d91f85f6cd463c /app/controllers/groups_controller.rb
parentde251bcf6d0f1db8858fa38ac14e108c1b9ea00f (diff)
downloadgitlab-ce-ec20fdf366843e60ed30abb5322c3c1b8f471b4a.tar.gz
Code improvements and add Create group service
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 54f14e62ead..5baeb3def08 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -29,10 +29,8 @@ class GroupsController < Groups::ApplicationController
def create
@group = Group.new(group_params)
- @group.name = @group.path.dup unless @group.name
- if @group.save
- @group.add_owner(current_user)
+ if Groups::CreateService.new(@group, current_user, group_params).execute
redirect_to @group, notice: "Group '#{@group.name}' was successfully created."
else
render action: "new"