Class: ActiveRecord::LogSubscriber

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

Instance Method Summary collapse

Methods included from Flog::PayloadValueShuntable

#shunt_payload_value

Instance Method Details

#sql_with_flog(event) ⇒ Object



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

def sql_with_flog(event)
  return sql_without_flog(event) unless Flog::Status.enabled?

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

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