From eede6962a8c1ee86b49907c1937fb0e3a38cf819 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 18 May 2009 01:50:39 -0400 Subject: Log queries to debug.log when running specs --- spec/connections/mysql_connection.rb | 2 ++ spec/connections/postgresql_connection.rb | 2 ++ spec/connections/sqlite3_connection.rb | 2 ++ 3 files changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/connections/mysql_connection.rb b/spec/connections/mysql_connection.rb index b4e27f2380..a58ddc35ef 100644 --- a/spec/connections/mysql_connection.rb +++ b/spec/connections/mysql_connection.rb @@ -1,6 +1,8 @@ require "activerecord" puts "Using native MySQL" +ActiveRecord::Base.logger = Logger.new("debug.log") + ActiveRecord::Base.configurations = { 'unit' => { :adapter => 'mysql', diff --git a/spec/connections/postgresql_connection.rb b/spec/connections/postgresql_connection.rb index 505dcdd1ef..e376d33ec6 100644 --- a/spec/connections/postgresql_connection.rb +++ b/spec/connections/postgresql_connection.rb @@ -1,6 +1,8 @@ require "activerecord" puts "Using native PostgreSQL" +ActiveRecord::Base.logger = Logger.new("debug.log") + ActiveRecord::Base.configurations = { 'unit' => { :adapter => 'postgresql', diff --git a/spec/connections/sqlite3_connection.rb b/spec/connections/sqlite3_connection.rb index bae077711d..649492f804 100644 --- a/spec/connections/sqlite3_connection.rb +++ b/spec/connections/sqlite3_connection.rb @@ -1,6 +1,8 @@ require "activerecord" puts "Using native SQLite3" +ActiveRecord::Base.logger = Logger.new("debug.log") + db_file = "spec/fixtures/fixture_database.sqlite3" ActiveRecord::Base.configurations = { -- cgit v1.2.3