From 688449f3f070f34f050468c2fbe4f6847d7d7699 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 15 Oct 2022 11:45:37 +0800 Subject: [PATCH] fix error --- app/controllers/admin/asks_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 3235baf..9bcbed2 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -157,8 +157,12 @@ class Admin::AsksController < OrbitAdminController @table_fields = @ask_list_setting.default_fields.select{|f| @ask_setting.default_setting[f].nil? || @ask_setting.default_setting[f] } if @category_id.present? ask_setting = AskCategorySetting.where(:category_id=>@category_id, :use_default.ne=>true).first - ask_setting = AskSetting.first if ask_setting.nil? - tmp = ask_setting.custom_fields + if ask_setting.nil? + ask_setting = AskSetting.first + tmp = ask_setting.custom_fields.map{|k,v| ["default@#{k}", v]} + else + tmp = ask_setting.custom_fields.map{|k,v| ["custom@#{k}", v]} + end list_setting_custom_fields = @ask_list_setting.custom_fields else tmp = []