class Lograge::ActiveRecordLogSubscriber
Log subscriber to replace ActiveRecord's default one
Public Instance Methods
sql(event)
click to toggle source
Every time there's an SQL query, stores it into the Thread. They'll later be access from the RequestLogSubscriber.
# File lib/lograge/active_record_log_subscriber.rb, line 8 def sql(event) ActiveRecord::LogSubscriber.runtime += event.duration return if event.payload[:name] == 'SCHEMA' Lograge::Sql.store[:lograge_sql_queries] ||= [] Lograge::Sql.store[:lograge_sql_queries] << Lograge::Sql.extract_event.call(event) end