diff options
author | Vladimir Dementyev <dementiev.vm@gmail.com> | 2019-02-14 13:59:10 -0500 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2019-02-14 16:22:03 -0800 |
commit | c43c83984792ac546e7610c898cf9099cc1a2ee6 (patch) | |
tree | bac5a0974cde406e72fe6ee8e2bcb76827599da5 /actioncable | |
parent | 6183483fa13bb1cac7e32f64df568fc2f9fb9a6b (diff) | |
download | rails-c43c83984792ac546e7610c898cf9099cc1a2ee6.tar.gz rails-c43c83984792ac546e7610c898cf9099cc1a2ee6.tar.bz2 rails-c43c83984792ac546e7610c898cf9099cc1a2ee6.zip |
feat: support channel_prefix in pg subscription adapter
Diffstat (limited to 'actioncable')
-rw-r--r-- | actioncable/CHANGELOG.md | 6 | ||||
-rw-r--r-- | actioncable/lib/action_cable/subscription_adapter/postgresql.rb | 2 | ||||
-rw-r--r-- | actioncable/test/subscription_adapter/postgresql_test.rb | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index 3ce35edbb8..600d4e130f 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -1,3 +1,9 @@ +* PostgreSQL subscription adapters now support `channel_prefix` option in cable.yml + + Avoids channel name collisions when multiple apps use the same database for Action Cable. + + *Vladimir Dementyev* + * Allow passing custom configuration to `ActionCable::Server::Base`. You can now create a standalone Action Cable server with a custom configuration diff --git a/actioncable/lib/action_cable/subscription_adapter/postgresql.rb b/actioncable/lib/action_cable/subscription_adapter/postgresql.rb index 50ec438c3a..1d60bed4af 100644 --- a/actioncable/lib/action_cable/subscription_adapter/postgresql.rb +++ b/actioncable/lib/action_cable/subscription_adapter/postgresql.rb @@ -8,6 +8,8 @@ require "digest/sha1" module ActionCable module SubscriptionAdapter class PostgreSQL < Base # :nodoc: + prepend ChannelPrefix + def initialize(*) super @listener = nil diff --git a/actioncable/test/subscription_adapter/postgresql_test.rb b/actioncable/test/subscription_adapter/postgresql_test.rb index 5fb26a8896..d262536d61 100644 --- a/actioncable/test/subscription_adapter/postgresql_test.rb +++ b/actioncable/test/subscription_adapter/postgresql_test.rb @@ -7,6 +7,7 @@ require "active_record" class PostgresqlAdapterTest < ActionCable::TestCase include CommonSubscriptionAdapterTest + include ChannelPrefixTest def setup database_config = { "adapter" => "postgresql", "database" => "activerecord_unittest" } |