chore: rubocop
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
This commit is contained in:
parent
f6fb804bbe
commit
fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions
|
|
@ -5,12 +5,12 @@ module LocalizeInput
|
|||
return input unless input.is_a? String
|
||||
|
||||
Rails.logger.debug { "Input: #{input.inspect}" }
|
||||
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
|
||||
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
|
||||
rescue
|
||||
rescue StandardError
|
||||
Rails.logger.warn "Can't localize input: #{input}"
|
||||
input
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue