1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-16 08:32:02 +00:00

Permit enumeration params.

git-svn-id: http://svn.redmine.org/redmine/trunk@16602 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-06-03 08:36:39 +00:00
parent 8e2983dd70
commit b923a54b2d

View File

@ -57,7 +57,7 @@ class EnumerationsController < ApplicationController
end
def update
if @enumeration.update_attributes(params[:enumeration])
if @enumeration.update_attributes(enumeration_params)
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
@ -91,7 +91,7 @@ class EnumerationsController < ApplicationController
def build_new_enumeration
class_name = params[:enumeration] && params[:enumeration][:type] || params[:type]
@enumeration = Enumeration.new_subclass_instance(class_name, params[:enumeration])
@enumeration = Enumeration.new_subclass_instance(class_name, enumeration_params)
if @enumeration.nil?
render_404
end
@ -102,4 +102,9 @@ class EnumerationsController < ApplicationController
rescue ActiveRecord::RecordNotFound
render_404
end
def enumeration_params
# can't require enumeration on #new action
params.permit(:enumeration => [:name, :active, :is_default])[:enumeration]
end
end