1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

load constants from within nested namespace rather than prioriting root

namespace
This commit is contained in:
liam 2017-12-20 11:53:31 +00:00 committed by Mike Perham
parent 84f17d97ed
commit 071a235e88

View file

@ -217,7 +217,9 @@ module Sidekiq
names.shift if names.empty? || names.first.empty? names.shift if names.empty? || names.first.empty?
names.inject(Object) do |constant, name| 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
end end