mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Revert Demon::DemonBase back to Demon::Base (#8132)
I introduced DemonBase because I had got some conflict between `demon/base.rb` and `jobs/base.rb`, however, to not rename base class, it is possible to use regex on absolute path in Zeitwerk custom inflector.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
module ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector
|
||||
CUSTOM_PATHS = {
|
||||
'base' => 'Jobs',
|
||||
'canonical_url' => 'CanonicalURL',
|
||||
'clean_up_unmatched_ips' => 'CleanUpUnmatchedIPs',
|
||||
'homepage_constraint' => 'HomePageConstraint',
|
||||
@@ -18,8 +17,9 @@ module ActiveSupport::Dependencies::ZeitwerkIntegration::Inflector
|
||||
'version' => 'Discourse',
|
||||
}
|
||||
|
||||
def self.camelize(basename, _abspath)
|
||||
return basename.camelize if _abspath =~ /onceoff\.rb$/
|
||||
def self.camelize(basename, abspath)
|
||||
return basename.camelize if abspath =~ /onceoff\.rb$/
|
||||
return 'Jobs' if abspath =~ /jobs\/base\.rb$/
|
||||
CUSTOM_PATHS.fetch(basename, basename.camelize)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user