summaryrefslogtreecommitdiffstats
path: root/app/controllers/custom_fields_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/custom_fields_controller.rb')
-rw-r--r--app/controllers/custom_fields_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb
index 230df1853..57cb73142 100644
--- a/app/controllers/custom_fields_controller.rb
+++ b/app/controllers/custom_fields_controller.rb
@@ -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