From 071a235e883a84774b742add63cf75fbb53d2cda Mon Sep 17 00:00:00 2001 From: liam Date: Wed, 20 Dec 2017 11:53:31 +0000 Subject: [PATCH] load constants from within nested namespace rather than prioriting root namespace --- lib/sidekiq/processor.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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