From 6d37c638e7eaa3daa48fe0408016be625bc22ef6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 15 Jan 2007 22:12:40 +0000 Subject: 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 --- .../connection_adapters/abstract/connection_specification.rb | 6 ++++-- .../lib/active_record/connection_adapters/abstract_adapter.rb | 2 +- .../lib/active_record/connection_adapters/sqlite_adapter.rb | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index 31c288b932..fbdbea499b 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -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 diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 07e3182761..d113897d46 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -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 diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 2d59c2f8fd..57520ea249 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -102,7 +102,7 @@ module ActiveRecord true end - def supports_reloading? + def requires_reloading? true end -- cgit v1.2.3