Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index a85ba6b..a7502db 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -945,16 +945,10 @@ module ActiveRecord
@fixture_cache = {}
@fixture_connections = []
- @@already_loaded_fixtures ||= {}
# Load fixtures once and begin transaction.
if run_in_transaction?
- if @@already_loaded_fixtures[self.class]
- @loaded_fixtures = @@already_loaded_fixtures[self.class]
- else
- @loaded_fixtures = load_fixtures(config)
- @@already_loaded_fixtures[self.class] = @loaded_fixtures
- end
+ @loaded_fixtures = load_fixtures(config)
@fixture_connections = enlist_fixture_connections
@fixture_connections.each do |connection|
connection.begin_transaction joinable: false
@@ -962,7 +956,6 @@ module ActiveRecord
# Load fixtures for every test.
else
ActiveRecord::FixtureSet.reset_cache
- @@already_loaded_fixtures[self.class] = nil
@loaded_fixtures = load_fixtures(config)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment