lib/niceql.rb in niceql-0.1.17 vs lib/niceql.rb in niceql-0.1.18
- old
+ new
@@ -139,11 +139,11 @@
module AbstractAdapterLogPrettifier
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 didn't break production
- formatted_sql = "\n" + Prettifier.prettify_sql(sql, false) rescue sql
+ formatted_sql = "\n" + Prettifier.prettify_sql(sql) rescue sql
super( formatted_sql, *args, &block )
end
end
module ErrorExt
@@ -174,11 +174,13 @@
def self.configure
yield( config )
if config.pg_adapter_with_nicesql
::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include(PostgresAdapterNiceQL)
- elsif config.prettify_active_record_log_output
- ::ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend( AbstractAdapterLogPrettifier )
+ end
+
+ if config.prettify_active_record_log_output
+ ::ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(AbstractAdapterLogPrettifier)
end
end
def self.config
@config ||= NiceQLConfig.new