plugins initializing before initializers strikes again!
fixes #11033 Change-Id: I43a594249a6d22ed50e1c11c2b01d18b8afc80c3 Reviewed-on: https://gerrit.instructure.com/14059 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
parent
d56bf59ae3
commit
824e0cdb3e
|
@ -58,15 +58,17 @@ ActiveRecord::Base::ConnectionSpecification.class_eval do
|
|||
@connection_handlers[self.environment] ||= ActiveRecord::Base.connection_handler
|
||||
end
|
||||
|
||||
def self.ensure_handler
|
||||
new_handler = @connection_handlers[self.environment]
|
||||
if !new_handler
|
||||
new_handler = @connection_handlers[self.environment] = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
|
||||
ActiveRecord::Base.connection_handler.connection_pools.each do |model, pool|
|
||||
new_handler.establish_connection(model, pool.spec)
|
||||
unless self.respond_to?(:ensure_handler)
|
||||
def self.ensure_handler
|
||||
new_handler = @connection_handlers[self.environment]
|
||||
if !new_handler
|
||||
new_handler = @connection_handlers[self.environment] = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
|
||||
ActiveRecord::Base.connection_handler.connection_pools.each do |model, pool|
|
||||
new_handler.establish_connection(model, pool.spec)
|
||||
end
|
||||
end
|
||||
new_handler
|
||||
end
|
||||
new_handler
|
||||
end
|
||||
|
||||
def self.reset_connection_handler_cache!
|
||||
|
|
Loading…
Reference in New Issue