veeqo/activejob-uniqueness

0.1.2 bombs when initializing rake commands for a Rails app with Sidekiq

jarkko opened this issue · 1 comments

After updating from 0.1.1 to 0.1.2, any rake/rails or bundle exec command bombs with the following error:

/Users/jarkko/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activejob-uniqueness-0.1.2/lib/active_job/uniqueness/patch.rb:79:in `block in <module:Uniqueness>': undefined method `to_sym' for nil:NilClass (NoMethodError)

This seems to be because the newly added on_load hook is already run in the Bundler.require(*Rails.groups) phase, i.e. before the queue adapter (or any other actual config) has been set in config/application.rb.

@jarkko Thank you for the report 👍 I'll try to fix the problem this week.