Module: RailsSQLPrettifier::AbstractAdapterLogPrettifier

Defined in:
lib/rails_sql_prettifier.rb

Instance Method Summary collapse

Instance Method Details

#log(sql, *args, &block) ⇒ Object



31
32
33
34
35
36
# File 'lib/rails_sql_prettifier.rb', line 31

def log( sql, *args, &block )
  # \n need to be placed because AR log will start with action description + time info.
  # rescue sql - just to be sure Prettifier wouldn't break production
  formatted_sql = "\n" + Niceql::Prettifier.prettify_sql(sql) rescue sql
  super( formatted_sql, *args, &block )
end