aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/connection
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-06-02 04:08:48 +0930
committerMatthew Draper <matthew@trebex.net>2016-06-02 04:08:48 +0930
commita8df1bc345bf062e98bda64ef9638f65292c4b56 (patch)
tree84ee84e5f1bbfafa07b4598d6fa5f122b91e6fd4 /actioncable/lib/action_cable/connection
parent7b75ca100de247a40c78da89e28f4d71e0635b95 (diff)
downloadrails-a8df1bc345bf062e98bda64ef9638f65292c4b56.tar.gz
rails-a8df1bc345bf062e98bda64ef9638f65292c4b56.tar.bz2
rails-a8df1bc345bf062e98bda64ef9638f65292c4b56.zip
Properly support reloading for Action Cable channels
Diffstat (limited to 'actioncable/lib/action_cable/connection')
-rw-r--r--actioncable/lib/action_cable/connection/subscriptions.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/lib/action_cable/connection/subscriptions.rb b/actioncable/lib/action_cable/connection/subscriptions.rb
index 3742f248d1..6051818bfb 100644
--- a/actioncable/lib/action_cable/connection/subscriptions.rb
+++ b/actioncable/lib/action_cable/connection/subscriptions.rb
@@ -26,12 +26,12 @@ module ActionCable
id_key = data['identifier']
id_options = ActiveSupport::JSON.decode(id_key).with_indifferent_access
- subscription_klass = connection.server.channel_classes[id_options[:channel]]
+ subscription_klass = id_options[:channel].safe_constantize
- if subscription_klass
+ if subscription_klass && ActionCable::Channel::Base >= subscription_klass
subscriptions[id_key] ||= subscription_klass.new(connection, id_key, id_options)
else
- logger.error "Subscription class not found (#{data.inspect})"
+ logger.error "Subscription class not found: #{id_options[:channel].inspect}"
end
end