aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable
diff options
context:
space:
mode:
authorVladimir Dementyev <dementiev.vm@gmail.com>2019-01-22 15:06:16 -0500
committerVladimir Dementyev <dementiev.vm@gmail.com>2019-01-22 15:29:12 -0500
commit513dd2cfdb98c01bce9759b29c48aa8b691f53d4 (patch)
treed0e0b876cc41887fb9398b9543c9b278a554465d /actioncable/lib/action_cable
parent35bef64718f85ef550916f840fd10a9288185577 (diff)
downloadrails-513dd2cfdb98c01bce9759b29c48aa8b691f53d4.tar.gz
rails-513dd2cfdb98c01bce9759b29c48aa8b691f53d4.tar.bz2
rails-513dd2cfdb98c01bce9759b29c48aa8b691f53d4.zip
Add note about broadcast_to/broadcasting_for to change log
Diffstat (limited to 'actioncable/lib/action_cable')
-rw-r--r--actioncable/lib/action_cable/channel/broadcasting.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actioncable/lib/action_cable/channel/broadcasting.rb b/actioncable/lib/action_cable/channel/broadcasting.rb
index 6c7aec49e3..9f702e425e 100644
--- a/actioncable/lib/action_cable/channel/broadcasting.rb
+++ b/actioncable/lib/action_cable/channel/broadcasting.rb
@@ -15,7 +15,12 @@ module ActionCable
ActionCable.server.broadcast(broadcasting_for(model), message)
end
- # Returns a unique broadcasting identifier for this <tt>model</tt> in this channel.
+ # Returns a unique broadcasting identifier for this <tt>model</tt> in this channel:
+ #
+ # CommentsChannel.broadcasting_for("all") # => "comments:all"
+ #
+ # You can pass any object as a target (e.g. Active Record model), and it
+ # would be serialized into a string under the hood.
def broadcasting_for(model)
serialize_broadcasting([ channel_name, model ])
end