mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-15 14:20:54 +00:00
User profile param fix
This commit is contained in:
parent
25761db2f3
commit
f51af16ca2
3 changed files with 35 additions and 31 deletions
|
@ -53,7 +53,8 @@ class Issue < ActiveRecord::Base
|
||||||
|
|
||||||
before_validation :init_variables, :if => Proc.new{|issue| issue.new_record?}
|
before_validation :init_variables, :if => Proc.new{|issue| issue.new_record?}
|
||||||
before_save :parse_text
|
before_save :parse_text
|
||||||
after_save :remove_readings
|
# FIXME
|
||||||
|
# after_save :remove_readings
|
||||||
|
|
||||||
acts_as_readable
|
acts_as_readable
|
||||||
|
|
||||||
|
|
|
@ -355,6 +355,9 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.params(params, cuser)
|
def self.params(params, cuser)
|
||||||
params.require(:user).permit(:raw_password, :firstname, :lastname, :email, :steamid, :country, :birthdate, :timezone, :public_email, :filter, :team_id)
|
profile_attrs = cuser.profile.attributes.keys - ["id", "created_at", "updated_at"]
|
||||||
|
allowed = [:raw_password, :firstname, :lastname, :email, :steamid, :country, :birthdate, :timezone, :public_email, :filter, :time_zone, :team_id, profile_attributes: [profile_attrs]]
|
||||||
|
allowed << :username if cuser.admin?
|
||||||
|
params.require(:user).permit(*allowed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue