class ArQueryMatchers::Queries::UpdateCounter::UpdateQueryFilter

Constants

TABLE_NAME_SQL_PATTERN

Matches unnamed SQL operations like the following: “UPDATE `bank_account_verifications` …”

Public Instance Methods

filter_map(_name, sql) click to toggle source
# File lib/ar_query_matchers/queries/update_counter.rb, line 22
def filter_map(_name, sql)
  # for updates, name is always 'SQL', we have to rely on pattern matching on the query string instead.
  select_from_table = sql.match(TABLE_NAME_SQL_PATTERN)
  TableName.new(select_from_table[:table_name]) if select_from_table
end