From 9529f4c2c3668a2c410fe23905c3cb0d5ad8074e Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 15 Oct 2022 12:35:32 +0800 Subject: [PATCH] fix error --- app/helpers/admin/asks_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/admin/asks_helper.rb b/app/helpers/admin/asks_helper.rb index d861616..40fc394 100644 --- a/app/helpers/admin/asks_helper.rb +++ b/app/helpers/admin/asks_helper.rb @@ -212,9 +212,9 @@ module Admin::AsksHelper if !object.nil? value = object.custom_values[k] if value.nil? - if k.start_with("default@") + if k.start_with?("default@") value = object.custom_values[k.sub(/.*@/,'')] - elsif k.start_with("custom@") + elsif k.start_with?("custom@") category_id, k = k.scan(/custom@((?:(?!@).)*)@\w+/)[0][0] if category_id==object.category_id.to_s value = object.custom_values[k]