mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Improve method description
Method description improved to reflect little bit more complicated scenario when names are camel-cased.
This commit is contained in:
parent
8327f63dec
commit
a3c4d035f0
1 changed files with 1 additions and 0 deletions
|
@ -10,6 +10,7 @@ module ActionCable
|
|||
#
|
||||
# ChatChannel.channel_name # => 'chat'
|
||||
# Chats::AppearancesChannel.channel_name # => 'chats:appearances'
|
||||
# FooChats::BarAppearancesChannel.channel_name # => 'foo_chats:bar_appearances'
|
||||
def channel_name
|
||||
@channel_name ||= name.sub(/Channel$/, '').gsub('::',':').underscore
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue