diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index da48e0d41..c6709eb46 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -5,11 +5,16 @@ config.use_transactional_fixtures = false config.before(:suite) do - ActiveRecord::Tasks::DatabaseTasks.truncate_all + ApplicationRecord.connection_pool.with_connection do |connection| + connection.truncate_tables(*connection.tables) + end end config.around do |example| example.run - ActiveRecord::Tasks::DatabaseTasks.truncate_all + + ApplicationRecord.connection_pool.with_connection do |connection| + connection.truncate_tables(*connection.tables) + end end end