88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# File 'lib/disable_test_fixtures.rb', line 88
def setup_fixtures
unless fixtures_disabled?
self.last_test_loaded_fixtures = true
return super end
if last_test_loaded_fixtures?
unless (loaded_fixtures = already_loaded_fixtures).blank?
clear_loaded_fixtures(loaded_fixtures)
end
end
self.last_test_loaded_fixtures = false
@fixture_cache = {} @fixture_connections = [] if enlist = respond_to?(:enlist_fixture_connections)
if use_transactional_fixtures? if enlist
@fixture_connections = enlist_fixture_connections
@fixture_connections.each do |connection|
connection.increment_open_transactions
connection.transaction_joinable = false
connection.begin_db_transaction
end
else
connection = ActiveRecord::Base.connection
connection.increment_open_transactions
connection.transaction_joinable = false if connection.respond_to?(:transaction_joinable=)
connection.begin_db_transaction
end
else
Fixtures.reset_cache end
end
|