Skip to content

Accept any Que::Adapters::Base subclass in Que.connection=#119

Open
BBrannick wants to merge 1 commit into
masterfrom
custom-adapter-index-hints
Open

Accept any Que::Adapters::Base subclass in Que.connection=#119
BBrannick wants to merge 1 commit into
masterfrom
custom-adapter-index-hints

Conversation

@BBrannick

Copy link
Copy Markdown

Replace the hardcoded class-name whitelist with an is_a?(Adapters::Base) guard, so external adapter subclasses (e.g. defined in consuming apps) can be passed directly without raising "Que connection not recognized".

Comment thread lib/que.rb Outdated
self.adapter =
if connection.to_s == "ActiveRecord"
Adapters::ActiveRecord.new
elsif connection.is_a?(Adapters::Base)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other adapters are also inherent from the Base (for example, Adapters::Pond), and it will stop working
probably need to move this below the case for them

Replace the hardcoded class-name whitelist with an is_a?(Adapters::Base)
guard, so external adapter subclasses (e.g. defined in consuming apps) can
be passed directly without raising "Que connection not recognized".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@BBrannick BBrannick force-pushed the custom-adapter-index-hints branch from 0ad566e to dc28a65 Compare June 11, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants