Set group name from path in admin controller

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-12-22 13:55:32 +02:00
parent ed2bcf952b
commit 52a8e5c01a
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A

View file

@ -21,7 +21,7 @@ class Admin::GroupsController < Admin::ApplicationController
def create
@group = Group.new(group_params)
@group.path = @group.name.dup.parameterize if @group.name
@group.name = @group.path.dup unless @group.name
if @group.save
@group.add_owner(current_user)