aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/server.rb')
-rw-r--r--lib/action_cable/server.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/action_cable/server.rb b/lib/action_cable/server.rb
index 4ee6b15982..1b444a4e7a 100644
--- a/lib/action_cable/server.rb
+++ b/lib/action_cable/server.rb
@@ -47,8 +47,12 @@ module ActionCable
id_key = data['identifier']
id_options = ActiveSupport::JSON.decode(id_key).with_indifferent_access
- if subscription = registered_channels.detect { |channel_klass| channel_klass.matches?(id_options) }
- @subscriptions[id_key] = subscription.new(self, id_key, id_options)
+ subscription_klass = registered_channels.detect do |channel_klass|
+ channel_klass.channel_name == id_options[:channel] && channel_klass.matches?(id_options)
+ end
+
+ if subscription_klass
+ @subscriptions[id_key] = subscription_klass.new(self, id_key, id_options)
@subscriptions[id_key].subscribe
else
# No channel found