From ae8d222f8220f5e32125f955edc55db64ba30053 Mon Sep 17 00:00:00 2001 From: viehlieb Date: Tue, 28 Mar 2023 17:03:24 +0200 Subject: [PATCH] prepare for plugin import --- Gemfile | 1 + Gemfile.lock | 9 +++++++++ app/models/concerns/localize_input.rb | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e1ed43a7..a6106f2a 100644 --- a/Gemfile +++ b/Gemfile @@ -62,6 +62,7 @@ gem 'rswag-ui' # we use the git version of acts_as_versioned, and need to include it in this Gemfile gem 'acts_as_versioned', git: 'https://github.com/technoweenie/acts_as_versioned.git' +gem 'foodsoft_article_import', path: 'plugins/article_import' gem 'foodsoft_wiki', path: 'plugins/wiki' gem 'foodsoft_messages', path: 'plugins/messages' gem 'foodsoft_documents', path: 'plugins/documents' diff --git a/Gemfile.lock b/Gemfile.lock index a07ffe93..c87f77ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,6 +16,14 @@ GIT acts_as_versioned (0.6.0) activerecord (>= 3.0.9) +PATH + remote: plugins/article_import + specs: + foodsoft_article_import (0.0.1) + deface (~> 1.0) + rails + roo (~> 2.9.0) + PATH remote: plugins/discourse specs: @@ -617,6 +625,7 @@ DEPENDENCIES exception_notification factory_bot_rails faker + foodsoft_article_import! foodsoft_discourse! foodsoft_documents! foodsoft_links! diff --git a/app/models/concerns/localize_input.rb b/app/models/concerns/localize_input.rb index cfb44a44..b6330fcc 100644 --- a/app/models/concerns/localize_input.rb +++ b/app/models/concerns/localize_input.rb @@ -8,7 +8,7 @@ module LocalizeInput separator = I18n.t("separator", scope: "number.format") delimiter = I18n.t("delimiter", scope: "number.format") input.gsub!(delimiter, "") if input.match(/\d+#{Regexp.escape(delimiter)}+\d+#{Regexp.escape(separator)}+\d+/) # Remove delimiter - input.gsub!(separator, ".") # Replace separator with db compatible character + input.gsub!(separator, ".") or input.gsub!(",", ".") # Replace separator with db compatible character input rescue Rails.logger.warn "Can't localize input: #{input}"