From 955bf93549f336d95862b12079f8b88f99145f8b Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 17 Jan 2015 11:39:28 +0530 Subject: Use underscored class name as the default channel name --- lib/action_cable/channel/base.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/action_cable/channel/base.rb') diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index 1ede07d9e3..6eaade4c8f 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -15,6 +15,10 @@ module ActionCable 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 = {}) -- cgit v1.2.3