Class: ActiveRecord::LogSubscriber

Inherits:
Object
  • Object
show all
Includes:
PayloadValueShuntable
Defined in:
lib/flog/sql_formattable.rb

Instance Method Summary collapse

Methods included from PayloadValueShuntable

#shunt_payload_value

Instance Method Details

#original_sqlObject



8
# File 'lib/flog/sql_formattable.rb', line 8

alias :original_sql :sql

#sql(event) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/flog/sql_formattable.rb', line 10

def sql(event)
  formatted = format_sql(event.payload[:sql])

  shunt_payload_value(event.payload, :sql, "\n\t#{formatted}") do
    original_sql(event)
  end
end