Use truncate_all instead of DatabaseCleaner

Performance tests show both methods of truncating the database take
about the same time, so we can remove one dependency and we don't lose
anything in the process.
This commit is contained in:
Javi Martín
2021-09-19 22:18:11 +02:00
parent f8ec98c2a6
commit 480ab6a9da
4 changed files with 2 additions and 13 deletions

View File

@@ -1,7 +1,4 @@
unless Rails.env.test?
require "database_cleaner"
DatabaseCleaner.clean_with :truncation
end
ActiveRecord::Tasks::DatabaseTasks.truncate_all unless Rails.env.test?
@logger = Logger.new(STDOUT)
@logger.formatter = proc do |_severity, _datetime, _progname, msg|
msg unless @avoid_log