aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/channel/base.rb
diff options
context:
space:
mode:
authorDiego Ballona <root@dballona.com>2015-10-31 18:50:54 -0200
committerDiego Ballona <root@dballona.com>2015-11-04 13:42:56 -0200
commit351a663e57f2f20b3cd43b9ed751430665463659 (patch)
tree8bf14769b786eec74275cb5671204c4cd844f310 /lib/action_cable/channel/base.rb
parentbb322ee19d203ff70cee79a058f3cae406ae338c (diff)
downloadrails-351a663e57f2f20b3cd43b9ed751430665463659.tar.gz
rails-351a663e57f2f20b3cd43b9ed751430665463659.tar.bz2
rails-351a663e57f2f20b3cd43b9ed751430665463659.zip
Fixing subscription callbacks
Diffstat (limited to 'lib/action_cable/channel/base.rb')
-rw-r--r--lib/action_cable/channel/base.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb
index 7607b5ad59..2d528dfdbf 100644
--- a/lib/action_cable/channel/base.rb
+++ b/lib/action_cable/channel/base.rb
@@ -143,7 +143,9 @@ module ActionCable
# Called by the cable connection when its cut so the channel has a chance to cleanup with callbacks.
# This method is not intended to be called directly by the user. Instead, overwrite the #unsubscribed callback.
def unsubscribe_from_channel
- _run_unsubscribe_callbacks { unsubscribed }
+ run_callbacks :unsubscribe do
+ unsubscribed
+ end
end
@@ -192,7 +194,9 @@ module ActionCable
def subscribe_to_channel
- _run_subscribe_callbacks { subscribed }
+ run_callbacks :subscribe do
+ subscribed
+ end
transmit_subscription_confirmation unless defer_subscription_confirmation?
end
@@ -227,7 +231,6 @@ module ActionCable
unless subscription_confirmation_sent?
logger.info "#{self.class.name} is transmitting the subscription confirmation"
connection.transmit ActiveSupport::JSON.encode(identifier: @identifier, type: SUBSCRIPTION_CONFIRMATION_INTERNAL_MESSAGE)
-
@subscription_confirmation_sent = true
end
end