lib/fixtury/minitest_hooks.rb in fixtury-1.0.0.beta7 vs lib/fixtury/minitest_hooks.rb in fixtury-1.0.0
- old
+ new
@@ -142,10 +142,11 @@
#
# @return [Array<ActiveRecord::ConnectionAdapters::AbstractAdapter>] The list of database connections.
def fixtury_database_connections
return [] unless defined?(ActiveRecord::Base)
- ActiveRecord::Base.connection_handler.connection_pool_list(:writing).map(&:connection)
+ pools = ActiveRecord::Base.connection_handler.connection_pool_list(:writing)
+ pools.map { |pool| pool.respond_to?(:lease_connection) ? pool.lease_connection : pool.connection }
end
# Load all dependenct fixtures and begin a transaction for each database connection.
def fixtury_setup
Fixtury.store.clear_stale_references!