mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fix failure to retain value of allow_concurrency
- Also carry allow_concurrency value through to connection adapter (for postgresql)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user