From 127880a73fa461400c53b29c98721e34660bca5e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 10 Dec 2020 14:46:41 +0000 Subject: [PATCH] Switch to using the zeitwork autoloader --- app/validators/utf8_validator.rb | 2 +- config/application.rb | 3 --- config/initializers/inflections.rb | 17 ++++++----------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/validators/utf8_validator.rb b/app/validators/utf8_validator.rb index 0c6b3f594..dec6f4d96 100644 --- a/app/validators/utf8_validator.rb +++ b/app/validators/utf8_validator.rb @@ -2,7 +2,7 @@ # validation method to be included like any other validations methods # in the models definitions. this one checks that the named attribute # is a valid UTF-8 format string. -class Utf8Validator < ActiveModel::EachValidator +class UTF8Validator < ActiveModel::EachValidator def validate_each(record, attribute, value) record.errors.add(attribute, " is invalid UTF-8") unless UTF8.valid? value end diff --git a/config/application.rb b/config/application.rb index 54390ba29..f5638e233 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,9 +31,6 @@ module OpenStreetMap # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W[#{config.root}/lib] - # Continue to use the classic autoloader for now - config.autoloader = :classic - # Force requests from old versions of IE (<= IE8) to be UTF-8 encoded. # This has defaulted to false since rails 6.0 config.action_view.default_enforce_utf8 = true diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf9d..3a842d7d5 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -3,14 +3,9 @@ # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.acronym "GPX" + inflect.acronym "ID" + inflect.acronym "OSM" + inflect.acronym "UTF8" +end -- 2.39.5