aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorNick <nick@nicksieger.com>2008-04-19 23:11:28 -0500
committerNick Sieger <nick@nicksieger.com>2008-08-29 14:12:09 -0500
commit37b0b36918f14519b28326057bba38ca6fcfbd3b (patch)
tree1b8589df269d81a3defbe775f709735be1c512c6 /activerecord/lib/active_record/connection_adapters
parentcab76ce6ac2983f59451e2d53b23746a2873aea0 (diff)
downloadrails-37b0b36918f14519b28326057bba38ca6fcfbd3b.tar.gz
rails-37b0b36918f14519b28326057bba38ca6fcfbd3b.tar.bz2
rails-37b0b36918f14519b28326057bba38ca6fcfbd3b.zip
Fix failure to retain value of allow_concurrency
- Also carry allow_concurrency value through to connection adapter (for postgresql)
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb3
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb1
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index 2d13d02fad..08fc61daaa 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -97,7 +97,8 @@ module ActiveRecord
if spec.kind_of?(ActiveRecord::ConnectionAdapters::AbstractAdapter)
active_connections[active_connection_name] = spec
elsif spec.kind_of?(ActiveRecord::Base::ConnectionSpecification)
- self.set_connection ActiveRecord::Base.send(spec.adapter_method, spec.config)
+ config = spec.config.reverse_merge(:allow_concurrency => ActiveRecord::Base.allow_concurrency)
+ self.set_connection ActiveRecord::Base.send(spec.adapter_method, config)
else
raise ConnectionNotEstablished
end
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 ed9d074506..ddca97c3bf 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
@@ -31,6 +31,7 @@ module ActiveRecord
# multi-threaded access of the connection pools hash is synchronized.
def allow_concurrency=(flag)
if @@allow_concurrency != flag
+ @@allow_concurrency = flag
if flag
self.connection_pools_lock = Monitor.new
else