isaacseymour / activejob-retry

Automatic retries for ActiveJob
MIT License
138 stars 14 forks source link

Undefined method `name` for ActiveJob::QueueAdapters::* #39

Closed polysiya closed 8 years ago

polysiya commented 8 years ago

When I tried to include ActiveJob::Retry like below.

class MyJob < ApplicationJob
  include ActiveJob::Retry.new(strategy: :exponential, limit: 25)
...

An exception like below happened.

NoMethodError:
       undefined method `name' for #<ActiveJob::QueueAdapters::SidekiqAdapter:0x007f9c7c00bd68>

ActiveJob::Base.queue_adapter.name doesn't seem to return Class any more. It returns an instance and doesn't have #name.

https://github.com/rails/rails/blob/1f8558fa2707e7707dcfef0aba94de9afcd05d3a/activejob/lib/active_job/queue_adapter.rb

isaacseymour commented 8 years ago

Thanks for the bug report @polysiya ! #40 fixes this, and also makes Travis run tests against Rails 5.0 and 4.2 so this can't happen again.