mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Added truncation support for Postgresql.
This commit is contained in:
parent
ee0c0c2152
commit
80408434da
2 changed files with 8 additions and 1 deletions
|
@ -19,6 +19,13 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
class PostgreSQLAdapter
|
||||
def truncate_table(table_name)
|
||||
execute("TRUNCATE TABLE #{table_name};")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
|
@ -3,7 +3,7 @@ require 'database_cleaner/active_record/truncation'
|
|||
require 'active_record'
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
[MysqlAdapter, SQLite3Adapter, JdbcAdapter].each do |adapter|
|
||||
[MysqlAdapter, SQLite3Adapter, JdbcAdapter, PostgreSQLAdapter].each do |adapter|
|
||||
describe adapter, "#truncate_table" do
|
||||
it "should truncate the table"
|
||||
end
|
Loading…
Reference in a new issue