Module: RailsSQLPrettifier::NiceqlExt

Included in:
RailsSQLPrettifier
Defined in:
lib/rails_sql_prettifier.rb

Instance Method Summary collapse

Instance Method Details

#configureObject


71
72
73
74
75
76
77
78
79
80
81
# File 'lib/rails_sql_prettifier.rb', line 71

def configure
  super

  if config.pg_adapter_with_nicesql && defined?( ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter )
    ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include( PostgresAdapterNiceQL)
  end

  ::ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend( AbstractAdapterLogPrettifier ) if config.prettify_active_record_log_output

  ::ActiveRecord::StatementInvalid.include( RailsSQLPrettifier::ErrorExt ) if config.prettify_pg_errors && config.ar_using_pg_adapter?
end