diff --git a/lib/sidekiq/processor.rb b/lib/sidekiq/processor.rb index 315c1bc5..4d31dceb 100644 --- a/lib/sidekiq/processor.rb +++ b/lib/sidekiq/processor.rb @@ -217,7 +217,9 @@ module Sidekiq names.shift if names.empty? || names.first.empty? names.inject(Object) do |constant, name| - constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name) + # the false flag limits search for name to under the constant namespace + # which mimics Rails' behaviour + constant.const_defined?(name, false) ? constant.const_get(name, false) : constant.const_missing(name) end end