2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
module DbCleaner
|
2019-09-30 21:07:59 +05:30
|
|
|
def delete_from_all_tables!(except: nil)
|
|
|
|
DatabaseCleaner.clean_with(:deletion, cache_tables: false, except: except)
|
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
def deletion_except_tables
|
|
|
|
[]
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
def setup_database_cleaner
|
|
|
|
DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }]
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|