mirror of
https://github.com/redmine/redmine.git
synced 2026-07-30 07:09:03 +02:00
Use safe_attributes for custom fields.
git-svn-id: http://svn.redmine.org/redmine/trunk@15689 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -53,7 +53,8 @@ class CustomFieldsController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
if @custom_field.update_attributes(params[:custom_field])
|
||||
@custom_field.safe_attributes = params[:custom_field]
|
||||
if @custom_field.save
|
||||
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@@ -82,9 +83,11 @@ class CustomFieldsController < ApplicationController
|
||||
private
|
||||
|
||||
def build_new_custom_field
|
||||
@custom_field = CustomField.new_subclass_instance(params[:type], params[:custom_field])
|
||||
@custom_field = CustomField.new_subclass_instance(params[:type])
|
||||
if @custom_field.nil?
|
||||
render :action => 'select_type'
|
||||
else
|
||||
@custom_field.safe_attributes = params[:custom_field]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user