Module: RailsSQLPrettifier::NiceqlError

Defined in:
lib/rails_sql_prettifier/niceql_error.rb

Instance Method Summary collapse

Instance Method Details

#to_sObject



4
5
6
7
8
# File 'lib/rails_sql_prettifier/niceql_error.rb', line 4

def to_s
  # older rails version do not provide sql as a standalone query, instead they
  # deliver joined message, and try(:sql) will set prettify_err with nil in that case
  Niceql.config.prettify_pg_errors ? Niceql::Prettifier.prettify_err(super, try(:sql) ) : super
end