Retrive the right pool for db tasks

上级 7d9d076e
......@@ -117,10 +117,10 @@ def create(*arguments)
end
def create_all
old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base)
old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base.specification_id)
each_local_configuration { |configuration| create configuration }
if old_pool
ActiveRecord::Base.connection_handler.establish_connection(ActiveRecord::Base, old_pool.spec)
ActiveRecord::Base.connection_handler.establish_connection(old_pool.spec)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册