From 029cd6881aa65cb6ee9e72a351e266d47cc223d9 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 21 Aug 2020 19:02:39 +0800 Subject: [PATCH] fix error --- app/controllers/admin/asks_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 3b1af7d..e46b94f 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -277,7 +277,9 @@ class Admin::AsksController < OrbitAdminController ask_setting = AskSetting.create() if ask_setting.nil? end if temp_params['custom_values'].nil? - temp_params['custom_values'] = {} + temp_params['custom_values'] = ask_setting.custom_values + else + temp_params['custom_values'] = ask_setting.custom_values.merge(temp_params['custom_values']) end ask_setting.custom_fields.select{|k,v| v['type']=='file' || v['type']=='image'}.each do |k,v| file = temp_params['custom_values'][k] rescue nil