FIX: deprecation warning - initialization autoloaded the constant (#12347)

Get rid of deprecation related to Zeitwerk autoloader.
This commit is contained in:
Krzysztof Kotlarek
2021-03-12 08:42:53 +11:00
committed by GitHub
parent b42ee6e296
commit 9a5a38a529
6 changed files with 163 additions and 150 deletions

View File

@ -1,23 +0,0 @@
# frozen_string_literal: true
module ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector
CUSTOM_PATHS = {
'canonical_url' => 'CanonicalURL',
'clean_up_unmatched_ips' => 'CleanUpUnmatchedIPs',
'homepage_constraint' => 'HomePageConstraint',
'ip_addr' => 'IPAddr',
'onpdiff' => 'ONPDiff',
'onceoff' => 'Jobs',
'pop3_polling_enabled_setting_validator' => 'POP3PollingEnabledSettingValidator',
'regular' => 'Jobs',
'scheduled' => 'Jobs',
'topic_query_sql' => 'TopicQuerySQL',
'version' => 'Discourse',
}
def self.camelize(basename, abspath)
return basename.camelize if abspath.ends_with?("onceoff.rb")
return 'Jobs' if abspath.ends_with?("jobs/base.rb")
CUSTOM_PATHS.fetch(basename, basename.camelize)
end
end