From 35bef64718f85ef550916f840fd10a9288185577 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Tue, 22 Jan 2019 14:31:51 -0500 Subject: [PATCH] Add Channel#broadcast_to --- actioncable/lib/action_cable/channel/broadcasting.rb | 2 +- actioncable/test/channel/test_case_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actioncable/lib/action_cable/channel/broadcasting.rb b/actioncable/lib/action_cable/channel/broadcasting.rb index bd900e1c655..6c7aec49e3a 100644 --- a/actioncable/lib/action_cable/channel/broadcasting.rb +++ b/actioncable/lib/action_cable/channel/broadcasting.rb @@ -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 model in this channel. diff --git a/actioncable/test/channel/test_case_test.rb b/actioncable/test/channel/test_case_test.rb index 9c360d5dc36..a166c41e114 100644 --- a/actioncable/test/channel/test_case_test.rb +++ b/actioncable/test/channel/test_case_test.rb @@ -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