Made sure that connections are only removed for SQLite

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5955 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2007-01-15 22:12:40 +00:00
parent 312e6edf91
commit 6d37c638e7
3 changed files with 6 additions and 4 deletions

View File

@@ -90,8 +90,10 @@ module ActiveRecord
# Clears the cache which maps classes
def clear_reloadable_connections!
@@active_connections.each do |name, conn|
conn.disconnect! if conn.supports_reloading?
@@active_connections.delete(name)
if conn.requires_reloading?
conn.disconnect!
@@active_connections.delete(name)
end
end
end

View File

@@ -81,7 +81,7 @@ module ActiveRecord
# Returns true if its safe to reload the connection between requests for development mode.
# This is not the case for Ruby/MySQL and it's not necessary for any adapters except SQLite.
def supports_reloading?
def requires_reloading?
false
end

View File

@@ -102,7 +102,7 @@ module ActiveRecord
true
end
def supports_reloading?
def requires_reloading?
true
end