From 7616e0525829d485868e1862f200dea07e6408a0 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Mon, 30 Jan 2023 11:21:41 +0800 Subject: [PATCH] Fix bug. --- .../admin/personal_plugin_fields_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/personal_plugin_fields_controller.rb b/app/controllers/admin/personal_plugin_fields_controller.rb index 428fafe..4f557ea 100644 --- a/app/controllers/admin/personal_plugin_fields_controller.rb +++ b/app/controllers/admin/personal_plugin_fields_controller.rb @@ -852,18 +852,18 @@ class Admin::PersonalPluginFieldsController < OrbitMemberController return new_text end def include_key(text,key) - return text.include?(key) || text.include?(key.classify) + return text.include?(key) || text.include?(key.camelize) end def gsub_text_by_key_value(text,k,v) @blank_texts = [] if !@parse_again_mode - text.gsub(/\n(\s+)[^\n]*(#{k}|#{k.classify})/m) {|ff| @blank_texts << $1.gsub(/(\r\n|\n)/,'')} + text.gsub(/\n(\s+)[^\n]*(#{k}|#{k.camelize})/m) {|ff| @blank_texts << $1.gsub(/(\r\n|\n)/,'')} end i = 0 text = text.gsub(k + "s"){|ff| v.pluralize.gsub("\n","\n#{@blank_texts[i]}")} text = text.gsub(k ){|ff| v.gsub("\n","\n#{@blank_texts[i]}")} - text = text.gsub(k.classify + "s"){|ff| v.classify.pluralize.gsub("\n","\n#{@blank_texts[i]}")} - text = text.gsub(k.classify){|ff| v.classify.gsub("\n","\n#{@blank_texts[i]}")} + text = text.gsub(k.camelize + "s"){|ff| v.camelize.pluralize.gsub("\n","\n#{@blank_texts[i]}")} + text = text.gsub(k.camelize){|ff| v.camelize.gsub("\n","\n#{@blank_texts[i]}")} end def get_all_gem_plugins extention_files = ["downloaded_extensions.rb","built_in_extensions.rb"]