1
0
Fork 0
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:
Roman Pushkin 2016-05-18 14:12:11 -07:00
parent 8327f63dec
commit a3c4d035f0

View file

@ -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