Class: ArQueryMatchers::Queries::QueryFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/ar_query_matchers/queries/query_filter.rb

Overview

An instance of this interface must be provided to the QueryCounter class. it allows one to customize which queries it wants to capture.

Instance Method Summary collapse

Instance Method Details

#filter_map(_name, _sql) ⇒ Object

For example: “User Load”

For example: “SELECT ‘users`.* FROM `users` ..”

By returning nil we omit the query By not returning nil, we are associating this query with a model_name.

Parameters:

  • _name (String)

    the name of the ActiveRecord operation (this is sometimes garbage)

  • _sql (String)

    the sql query that was executed

Returns:

  • nil or an instance which responds to #model_name (see TableName or ModelName)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/ar_query_matchers/queries/query_filter.rb', line 17

def filter_map(_name, _sql)
  raise NotImplementedError
end