diff options
-rw-r--r-- | lib/action_cable/server.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/action_cable/server.rb b/lib/action_cable/server.rb index e657f6d636..96d21416bf 100644 --- a/lib/action_cable/server.rb +++ b/lib/action_cable/server.rb @@ -88,17 +88,14 @@ module ActionCable end def process_message(message) - id_key = message['identifier'] - - if @subscriptions[id_key] - @subscriptions[id_key].receive(ActiveSupport::JSON.decode message['data']) + if @subscriptions[message['identifier']] + @subscriptions[message['identifier']].receive(ActiveSupport::JSON.decode message['data']) end end def unsubscribe_channel(data) - id_key = data['identifier'] - @subscriptions[id_key].unsubscribe - @subscriptions.delete(id_key) + @subscriptions[data['identifier']].unsubscribe + @subscriptions.delete(data['identifier']) end def invalid_request |