Add JdbcAdapter#truncate_table

This commit is contained in:
Kamal Fariz Mahyuddin 2009-03-05 18:05:00 +08:00
parent ddc8bd1dc2
commit 6a646819d7
2 changed files with 7 additions and 1 deletions

View File

@ -13,6 +13,12 @@ module ActiveRecord
end
end
class JdbcAdapter
def truncate_table(table_name)
execute("TRUNCATE TABLE #{table_name};")
end
end
end
end

View File

@ -3,7 +3,7 @@ require 'database_cleaner/active_record/truncation'
require 'active_record'
module ActiveRecord
module ConnectionAdapters
[MysqlAdapter, SQLite3Adapter].each do |adapter|
[MysqlAdapter, SQLite3Adapter, JdbcAdapter].each do |adapter|
describe adapter, "#truncate_table" do
it "should truncate the table"
end