diff options
author | Izaak Alpert <ialpert@blackberry.com> | 2013-08-15 17:43:46 -0400 |
---|---|---|
committer | Izaak Alpert <ialpert@blackberry.com> | 2013-09-11 14:04:15 -0400 |
commit | 5dae40f579f66fdc060de633b183ede7bd8b2ce4 (patch) | |
tree | f4f6669cb1e4d035eb89de116fb3d9ab1f596136 /app/controllers/admin/users_controller.rb | |
parent | d4d4a78f834b409631b012aa555c0cb2c4e3166d (diff) | |
download | gitlab-ce-5dae40f579f66fdc060de633b183ede7bd8b2ce4.tar.gz |
Update to only provide one way to get a default user
-calling build_user will now apply defaults and only override them if as: :admin is set
Change-Id: Id1d938c0967752ecc14370af54f2d88128d18c44
Diffstat (limited to 'app/controllers/admin/users_controller.rb')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 7809a157dbc..70bbe306562 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -13,7 +13,7 @@ class Admin::UsersController < Admin::ApplicationController end def new - @user = User.new.with_defaults + @user = User.build_user end def edit @@ -44,7 +44,7 @@ class Admin::UsersController < Admin::ApplicationController password_expires_at: Time.now } - @user = User.new(params[:user].merge(opts), as: :admin) + @user = User.build_user(params[:user].merge(opts), as: :admin) @user.admin = (admin && admin.to_i > 0) @user.created_by_id = current_user.id |