before_forkdo|server,worker|defined?(ActiveRecord::Base)andActiveRecord::Base.connection.disconnect!Test::ExternalData.connection.disconnect!# if ...endafter_forkdo|server,worker|defined?(ActiveRecord::Base)andActiveRecord::Base.establish_connectionTest::ExternalData.establish_connection# if ...end