prepare for plugin import

This commit is contained in:
viehlieb 2023-03-28 17:03:24 +02:00
parent bee1d68ff2
commit ae8d222f82
3 changed files with 11 additions and 1 deletions

View file

@ -62,6 +62,7 @@ gem 'rswag-ui'
# we use the git version of acts_as_versioned, and need to include it in this Gemfile # 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 '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_wiki', path: 'plugins/wiki'
gem 'foodsoft_messages', path: 'plugins/messages' gem 'foodsoft_messages', path: 'plugins/messages'
gem 'foodsoft_documents', path: 'plugins/documents' gem 'foodsoft_documents', path: 'plugins/documents'

View file

@ -16,6 +16,14 @@ GIT
acts_as_versioned (0.6.0) acts_as_versioned (0.6.0)
activerecord (>= 3.0.9) 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 PATH
remote: plugins/discourse remote: plugins/discourse
specs: specs:
@ -617,6 +625,7 @@ DEPENDENCIES
exception_notification exception_notification
factory_bot_rails factory_bot_rails
faker faker
foodsoft_article_import!
foodsoft_discourse! foodsoft_discourse!
foodsoft_documents! foodsoft_documents!
foodsoft_links! foodsoft_links!

View file

@ -8,7 +8,7 @@ module LocalizeInput
separator = I18n.t("separator", scope: "number.format") separator = I18n.t("separator", scope: "number.format")
delimiter = I18n.t("delimiter", 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!(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 input
rescue rescue
Rails.logger.warn "Can't localize input: #{input}" Rails.logger.warn "Can't localize input: #{input}"