From 49e50cad147cd24551b1cbb34f1768f83c3ec2e7 Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Sat, 22 May 2010 11:56:23 -0700 Subject: [PATCH] we don't need the connection around after a disconnect --- lib/active_record/connection_adapters/mysql2_adapter.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/mysql2_adapter.rb b/lib/active_record/connection_adapters/mysql2_adapter.rb index 825dd44..b5b5e83 100644 --- a/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -241,7 +241,10 @@ module ActiveRecord end def disconnect! - @connection.close + unless @connection.nil? + @connection.close + @connection = nil + end end def reset!