From cf426a7ee680e8cd30a4b5afccf7e140537836f4 Mon Sep 17 00:00:00 2001 From: "Mike A. Owens" Date: Mon, 24 Aug 2015 13:35:59 -0400 Subject: Use ActiveSupport::Callbacks for Channel subscription callbacks. * Rely on AS::Callbacks for callback handling. * Add before_subscribe, after_subscribe, before_unsubscribe and after_unsubscribe convenience methods * alias on_subscribe and on_unsubscribe to after_subscribe and after_unsubscribe, respectively. * Remove `subscribed` and `unsubscribed` from the callback chain: these methods are now executed as the subject of the callbacks. * Update portions of ActionCable to use the more specific callback names. --- test/channel/base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/channel') diff --git a/test/channel/base_test.rb b/test/channel/base_test.rb index e7944ff06b..ca632b124b 100644 --- a/test/channel/base_test.rb +++ b/test/channel/base_test.rb @@ -20,8 +20,8 @@ class ActionCable::Channel::BaseTest < ActiveSupport::TestCase class ChatChannel < BasicChannel attr_reader :room, :last_action - on_subscribe :toggle_subscribed - on_unsubscribe :toggle_subscribed + after_subscribe :toggle_subscribed + after_unsubscribe :toggle_subscribed def subscribed @room = Room.new params[:id] -- cgit v1.2.3