method

add

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: Subscriptions
add(data) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actioncable/lib/action_cable/connection/subscriptions.rb, line 25
      def add(data)
        id_key = data['identifier']
        id_options = ActiveSupport::JSON.decode(id_key).with_indifferent_access

        subscription_klass = id_options[:channel].safe_constantize

        if subscription_klass && ActionCable::Channel::Base >= subscription_klass
          subscriptions[id_key] ||= subscription_klass.new(connection, id_key, id_options)
        else
          logger.error "Subscription class not found: #{id_options[:channel].inspect}"
        end
      end
Register or log in to add new notes.