FIX: Demon base class depending of autoloader (#4)

FIX: Demon base class depending of autoloader (#4)

diff --git a/lib/demon.rb b/lib/demon.rb
index e47e7f7..c331788 100644
--- a/lib/demon.rb
+++ b/lib/demon.rb
@@ -1,8 +1,14 @@
 # frozen_string_literal: true
 
-require_dependency 'demon/base'
+if Rails.autoloaders.main.class == Zeitwerk::Loader
+  require_dependency 'demon/demon_base'
+else
+  require_dependency 'demon/base'
+end
+
+base_class = Rails.autoloaders.main.class == Zeitwerk::Loader ? Demon::DemonBase : Demon::Base
 
-class DiscoursePrometheus::Demon < Demon::Base
+class DiscoursePrometheus::Demon < base_class
   def self.prefix
     "prometheus-demon"
   end

GitHub sha: 584f7664