debian-mirror-gitlab/spec/support/db_cleaner.rb
2020-03-13 15:44:24 +05:30

19 lines
410 B
Ruby

# frozen_string_literal: true
module DbCleaner
def delete_from_all_tables!(except: [])
except << 'ar_internal_metadata'
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
DbCleaner.prepend_if_ee('EE::DbCleaner')