mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Add Mysql2Adapter#truncate_table
This commit is contained in:
parent
7e7caf9fe9
commit
1582731bb6
2 changed files with 8 additions and 2 deletions
|
@ -18,6 +18,12 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
class Mysql2Adapter < AbstractAdapter
|
||||
def truncate_table(table_name)
|
||||
execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
|
||||
end
|
||||
end
|
||||
|
||||
class SQLite3Adapter < SQLiteAdapter
|
||||
def truncate_table(table_name)
|
||||
execute("DELETE FROM #{quote_table_name(table_name)};")
|
||||
|
|
|
@ -5,8 +5,8 @@ require 'database_cleaner/active_record/truncation'
|
|||
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
[MysqlAdapter, SQLite3Adapter, JdbcAdapter, PostgreSQLAdapter].each do |adapter|
|
||||
describe(adapter, "#truncate_table") do
|
||||
[MysqlAdapter, Mysql2Adapter, SQLite3Adapter, JdbcAdapter, PostgreSQLAdapter].each do |adapter|
|
||||
describe adapter, "#truncate_table" do
|
||||
it "should truncate the table"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue