Merge pull request #29901 from kirs/actioncable-frozen-friendly

Make actioncable ready for frozen strings
This commit is contained in:
Sean Griffin 2017-07-23 16:25:55 -04:00 committed by GitHub
commit 68191d0f6e

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "set"
module ActionCable
@ -205,7 +207,9 @@ def unsubscribed # :doc:
# Transmit a hash of data to the subscriber. The hash will automatically be wrapped in a JSON envelope with
# the proper channel identifier marked as the recipient.
def transmit(data, via: nil) # :doc:
logger.debug "#{self.class.name} transmitting #{data.inspect.truncate(300)}".tap { |m| m << " (via #{via})" if via }
status = "#{self.class.name} transmitting #{data.inspect.truncate(300)}"
status += " (via #{via})" if via
logger.debug(status)
payload = { channel_class: self.class.name, data: data, via: via }
ActiveSupport::Notifications.instrument("transmit.action_cable", payload) do