Add Channel#broadcast_to

This commit is contained in:
Vladimir Dementyev 2019-01-22 14:31:51 -05:00
parent dc80459a9e
commit 35bef64718
No known key found for this signature in database
GPG Key ID: 8E0A19D3D1EDF5EB
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ module ActionCable
module Broadcasting
extend ActiveSupport::Concern
delegate :broadcasting_for, to: :class
delegate :broadcasting_for, :broadcast_to, to: :class
module ClassMethods
# Broadcast a hash to a unique broadcasting for this <tt>model</tt> in this channel.

View File

@ -180,7 +180,7 @@ class BroadcastsTestChannel < ActionCable::Channel::Base
def broadcast_to_user(data)
user = User.new user_id
self.class.broadcast_to user, text: data["message"]
broadcast_to user, text: data["message"]
end
end