module DatabaseCleaner::ActiveRecord::MysqlAdapter

Public Instance Methods

pre_count_truncate_tables(tables, options = {:reset_ids => true}) click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 49
def pre_count_truncate_tables(tables, options = {:reset_ids => true})
  filter = options[:reset_ids] ? method(:has_been_used?) : method(:has_rows?)
  truncate_tables(tables.select(&filter))
end
truncate_table(table_name) click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 41
def truncate_table(table_name)
  execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
end
truncate_tables(tables) click to toggle source
# File lib/database_cleaner/active_record/truncation.rb, line 45
def truncate_tables(tables)
  tables.each { |t| truncate_table(t) }
end