aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable')
-rw-r--r--lib/action_cable/channel/base.rb8
-rw-r--r--lib/action_cable/connection/subscriptions.rb4
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb
index 83ba2cb3d2..6c55a8ed65 100644
--- a/lib/action_cable/channel/base.rb
+++ b/lib/action_cable/channel/base.rb
@@ -10,16 +10,10 @@ module ActionCable
attr_reader :params, :connection
delegate :logger, to: :connection
- class_attribute :channel_name
-
class << self
def matches?(identifier)
raise "Please implement #{name}#matches? method"
end
-
- def find_name
- @name ||= channel_name || to_s.demodulize.underscore
- end
end
def initialize(connection, channel_identifier, params = {})
@@ -138,4 +132,4 @@ module ActionCable
end
end
end
-end \ No newline at end of file
+end
diff --git a/lib/action_cable/connection/subscriptions.rb b/lib/action_cable/connection/subscriptions.rb
index 9e7a8a5f73..ae191c7795 100644
--- a/lib/action_cable/connection/subscriptions.rb
+++ b/lib/action_cable/connection/subscriptions.rb
@@ -23,7 +23,7 @@ module ActionCable
id_options = ActiveSupport::JSON.decode(id_key).with_indifferent_access
subscription_klass = connection.server.registered_channels.detect do |channel_klass|
- channel_klass.find_name == id_options[:channel]
+ channel_klass == id_options[:channel].safe_constantize
end
if subscription_klass
@@ -66,4 +66,4 @@ module ActionCable
end
end
end
-end \ No newline at end of file
+end