Module: RuboCop::Cop::Isucon::Mixin::JoinWithoutIndexMethods

Includes:
DatabaseMethods
Included in:
RuboCop::Cop::Isucon::Mysql2::JoinWithoutIndex, Sqlite3::JoinWithoutIndex
Defined in:
lib/rubocop/cop/isucon/mixin/join_without_index_methods.rb

Overview

Instance Method Summary collapse

Methods included from DatabaseMethods

#connection, #enabled_database?, #find_table_name_from_column_name

Instance Method Details

#on_send(node) ⇒ Object

Parameters:

  • node (RuboCop::AST::Node)


13
14
15
16
17
18
19
20
21
# File 'lib/rubocop/cop/isucon/mixin/join_without_index_methods.rb', line 13

def on_send(node)
  with_error_handling(node) do
    return unless enabled_database?

    with_db_query(node) do |type, root_gda|
      check_and_register_offence(type: type, root_gda: root_gda, node: node)
    end
  end
end