Module: SQLOrigin::LogSubscriber

Extended by:
ActiveSupport::Concern
Defined in:
lib/sql_origin/hooks.rb

Instance Method Summary collapse

Instance Method Details

#sql_with_backtrace(event) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/sql_origin/hooks.rb', line 27

def sql_with_backtrace(event)
  return unless sql_without_backtrace(event)
  return unless event.payload[:backtrace]

  if event.payload[:backtrace].any?
    event.payload[:backtrace].each do |line|
      debug "    #{color line, "\e[90m", false}"
    end
  end
end