diff options
Diffstat (limited to 'lib/action_cable')
-rw-r--r-- | lib/action_cable/channel/base.rb | 7 | ||||
-rw-r--r-- | lib/action_cable/connection/base.rb | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index b0e112ce38..ca903a810d 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -89,9 +89,6 @@ module ActionCable include Naming include Broadcasting - SUBSCRIPTION_CONFIRMATION_INTERNAL_MESSAGE = 'confirm_subscription'.freeze - SUBSCRIPTION_REJECTION_INTERNAL_MESSAGE = 'reject_subscription'.freeze - attr_reader :params, :connection, :identifier delegate :logger, to: :connection @@ -258,7 +255,7 @@ module ActionCable def transmit_subscription_confirmation 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) + connection.transmit ActiveSupport::JSON.encode(identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:confirmation]) @subscription_confirmation_sent = true end end @@ -270,7 +267,7 @@ module ActionCable def transmit_subscription_rejection logger.info "#{self.class.name} is transmitting the subscription rejection" - connection.transmit ActiveSupport::JSON.encode(identifier: @identifier, type: SUBSCRIPTION_REJECTION_INTERNAL_MESSAGE) + connection.transmit ActiveSupport::JSON.encode(identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:rejection]) end end end diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index a988060d56..6df168e4c3 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -119,7 +119,7 @@ module ActionCable end def beat - transmit ActiveSupport::JSON.encode(identifier: '_ping', message: Time.now.to_i) + transmit ActiveSupport::JSON.encode(identifier: ActionCable::INTERNAL[:identifiers][:ping], message: Time.now.to_i) end |