Module: ActiveRecord::ConnectionAdapters::SelectWithSqlLogging

Included in:
Mysql2Adapter, MysqlAdapter
Defined in:
lib/sql-logging/adapters/pedant_mysql2.rb,
lib/sql-logging/adapters/mysql2.rb,
lib/sql-logging/adapters/mysql.rb

Instance Method Summary collapse

Instance Method Details

#select(sql, *args) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/sql-logging/adapters/pedant_mysql2.rb', line 5

def select(sql, *args)
  rows = nil
  elapsed = Benchmark.measure do
    rows = super(sql, *args)
  end
  msec = elapsed.real * 1000
  SqlLogging::Statistics.record_query(sql, args.first, msec, rows)
  rows
end