Skip to content

ActionCable Postgres adapter is ActiveRecord-specific #27214

Description

@bgentry

Steps to reproduce

  1. Create a Rails app using Sequel and sequel-rails, without ActiveRecord
  2. Attempt to use the ActionCable Postgres adapter
  3. Watch it crash trying to autoload ActiveRecord

Expected behavior

Ideally, this would support the most popular Postgres ORMs out of the box. Or at least the docs should mention that this only works with AR.

Actual behavior

Exception trying to autoload ActiveRecord

System configuration

Rails version: 5.0.0.1

Ruby version: 2.3.3

It was very easy to fork the Postgres ActionCable subscription adapter to work with Sequel. I only had to alter the with_connection method, which is even shorter with Sequel: https://gist.github.com/bgentry/5a4592dbbcc398c0ad651c53af7da51f#file-postgresql_sequel-rb-L35-L40

I'm not sure whether the right approach is to try to support this out-of-the-box, or at least to document that the adapter is AR-specific. Thoughts?

As a user I'd certainly prefer not to have to maintain a fork of the subscription adapter. But I can certainly see the argument for this not being Rails' problem. I suppose I really only need to monkey-patch or refine that one method, though, so not too bad either way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions