summaryrefslogtreecommitdiff
path: root/spec/support/db_cleaner.rb
blob: 08622dff6d9cfac539c92b880c6a3c58f6cd06b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module DbCleaner
  def delete_from_all_tables!(except: nil)
    DatabaseCleaner.clean_with(:deletion, cache_tables: false, except: except)
  end

  def deletion_except_tables
    []
  end

  def setup_database_cleaner
    DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }]
  end
end