diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9274de730..f8941041a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -28,6 +28,7 @@ class UsersController < ApplicationController def create @user = User.new params[:user] + @user.global_role_id = params[:user]['global_role_id'] if @user.save flash[:notice] = t('flash.user.saved') redirect_to users_path @@ -38,7 +39,7 @@ class UsersController < ApplicationController end def update - puts params[:user].inspect + @user.global_role_id = params[:user]['global_role_id'] if @user.update_attributes(params[:user]) flash[:notice] = t('flash.user.saved') redirect_to users_path diff --git a/app/models/user.rb b/app/models/user.rb index a9eb71bdc..ac7a909f6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ class User < ActiveRecord::Base errors.add(:uname, I18n.t('flash.user.group_uname_exists')) if Group.exists? :uname => uname } - attr_accessible :email, :password, :password_confirmation, :remember_me, :login, :name, :ssh_key, :uname, :global_role_id + attr_accessible :email, :password, :password_confirmation, :remember_me, :login, :name, :ssh_key, :uname attr_readonly :uname attr_accessor :login