Class: RuboCop::Cop::AnyCable::RemoteDisconnect

Inherits:
Cop
  • Object
show all
Defined in:
lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb

Overview

Checks for remote disconnect usage.

Examples:

# bad
class MyServive
  def call(user)
    ActionCable.server.remote_connections.where(current_user: user).disconnect
  end
end

Constant Summary collapse

MSG =
"Disconnecting remote clients is not supported in AnyCable"

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



25
26
27
# File 'lib/anycable/rails/compatibility/rubocop/cops/anycable/remote_disconnect.rb', line 25

def on_send(node)
  add_offense(node) if has_remote_disconnect?(node)
end