From 60499774c2a8ecd9d87b140ffbe24634559c3fcd Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 10 Jul 2005 04:54:34 +0000 Subject: Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]. Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1792 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/query_cache.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/query_cache.rb') diff --git a/activerecord/lib/active_record/query_cache.rb b/activerecord/lib/active_record/query_cache.rb index 95b4d8c915..c41567375f 100644 --- a/activerecord/lib/active_record/query_cache.rb +++ b/activerecord/lib/active_record/query_cache.rb @@ -51,8 +51,7 @@ module ActiveRecord QueryCache.new(self.send(spec.adapter_method, spec.config)) : self.send(spec.adapter_method, spec.config) - Thread.current['active_connections'] ||= {} - Thread.current['active_connections'][self] = conn + active_connections[self] = conn end end -- cgit v1.2.3