diff options
Diffstat (limited to 'activerecord/lib')
3 files changed, 6 insertions, 4 deletions
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 |