Steps to reproduce
- Create a Rails app using Sequel and sequel-rails, without ActiveRecord
- Attempt to use the ActionCable Postgres adapter
- 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.
Steps to reproduce
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_connectionmethod, which is even shorter with Sequel: https://gist.github.com/bgentry/5a4592dbbcc398c0ad651c53af7da51f#file-postgresql_sequel-rb-L35-L40I'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.