use new close method for disconnecting where we can

This commit is contained in:
Brian Lopez 2010-05-12 22:09:06 -07:00
parent e01c7581e5
commit 5b41082aba
2 changed files with 3 additions and 1 deletions

View File

@ -243,10 +243,12 @@ module ActiveRecord
end end
def disconnect! def disconnect!
@connection.close
@connection = nil @connection = nil
end end
def reset! def reset!
disconnect!
@connection = Mysql2::Client.new(@config) @connection = Mysql2::Client.new(@config)
end end

View File

@ -150,7 +150,7 @@ module Sequel
# Closes given database connection. # Closes given database connection.
def disconnect_connection(c) def disconnect_connection(c)
c = nil c.close
end end
# Convert tinyint(1) type to boolean if convert_tinyint_to_bool is true # Convert tinyint(1) type to boolean if convert_tinyint_to_bool is true