spec:fixture_builder:build establishes the test connection before loading the fixture builder:
ActiveRecord::Base.establish_connection(:test)
It does not restore the caller’s previous connection afterward. A later task in the same Rake process can therefore use the test database even while Rails.env still reports another environment.
This was reproduced on current master with separate development and test SQLite databases. Resetting Rails.env does not repair the connection leak.
This preserves safe task composition without automatically modifying Rails’ standard db:fixtures:load task.
spec:fixture_builder:buildestablishes the test connection before loading the fixture builder:It does not restore the caller’s previous connection afterward. A later task in the same Rake process can therefore use the test database even while
Rails.envstill reports another environment.This was reproduced on current
masterwith separate development and test SQLite databases. ResettingRails.envdoes not repair the connection leak.This preserves safe task composition without automatically modifying Rails’ standard
db:fixtures:loadtask.