Module: ActiveRecord::TestFixtures

Defined in:
lib/onceler/extensions/active_record.rb

Overview

monkey-patch this to not clear connections so that we don’t lose our transactions

Instance Method Summary collapse

Instance Method Details

#teardown_fixturesObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/onceler/extensions/active_record.rb', line 7

def teardown_fixtures
  # Rollback changes if a transaction is active.
  if run_in_transaction?
    @fixture_connections.each do |connection|
      connection.rollback_transaction if connection.transaction_open?
    end
    @fixture_connections.clear
  else
    ActiveRecord::FixtureSet.reset_cache
  end
  ### ONCELER'd
end