Fixed mass assignment to global_role_id
This commit is contained in:
parent
8f3ffbe827
commit
14bc7acc0b
|
@ -28,6 +28,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@user = User.new params[:user]
|
@user = User.new params[:user]
|
||||||
|
@user.global_role_id = params[:user]['global_role_id']
|
||||||
if @user.save
|
if @user.save
|
||||||
flash[:notice] = t('flash.user.saved')
|
flash[:notice] = t('flash.user.saved')
|
||||||
redirect_to users_path
|
redirect_to users_path
|
||||||
|
@ -38,7 +39,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
puts params[:user].inspect
|
@user.global_role_id = params[:user]['global_role_id']
|
||||||
if @user.update_attributes(params[:user])
|
if @user.update_attributes(params[:user])
|
||||||
flash[:notice] = t('flash.user.saved')
|
flash[:notice] = t('flash.user.saved')
|
||||||
redirect_to users_path
|
redirect_to users_path
|
||||||
|
|
|
@ -30,7 +30,7 @@ class User < ActiveRecord::Base
|
||||||
errors.add(:uname, I18n.t('flash.user.group_uname_exists')) if Group.exists? :uname => uname
|
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_readonly :uname
|
||||||
attr_accessor :login
|
attr_accessor :login
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue