Module: Niceql::AbstractAdapterLogPrettifier

Defined in:
lib/niceql.rb

Instance Method Summary collapse

Instance Method Details

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



235
236
237
238
239
240
# File 'lib/niceql.rb', line 235

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" + Prettifier.prettify_sql(sql) rescue sql
  super( formatted_sql, *args, &block )
end