nesquena / backburner

Simple and reliable beanstalkd job queue for ruby
http://nesquena.github.com/backburner
MIT License
430 stars 70 forks source link

Correctly remove the buildin rails adapter #181

Closed Earlopain closed 2 weeks ago

Earlopain commented 2 weeks ago

Followup to #180

defined? for a symbol literal is always truthy. defined?(ActiveJob::QueueAdapters::BackburnerAdapter) would also work as an alternative.

module ActiveJob
  module QueueAdapters
    # Adapter removed from rails
  end
end

module ActiveJob
  module QueueAdapters
    remove_const(:BackburnerAdapter) if defined?(:BackburnerAdapter)
  end
end

test.rb:10:in 'remove_const': constant ActiveJob::QueueAdapters::BackburnerAdapter not defined (NameError)

nesquena commented 2 weeks ago

Thanks