Permalink
Browse files

Added truncation support for Postgresql.

  • Loading branch information...
1 parent ee0c0c2 commit 80408434da46b3101f574217ef2cfb683056b5a4 Alberto Perdomo committed Mar 11, 2009
@@ -19,6 +19,13 @@ def truncate_table(table_name)
end
end
+ class PostgreSQLAdapter
+ def truncate_table(table_name)
+ execute("TRUNCATE TABLE #{table_name};")
+ end
+ end
+
+
end
end
@@ -3,7 +3,7 @@
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

1 comment on commit 8040843

bmabey commented on 8040843 Mar 12, 2009

Thanks for adding this! I have merged your commit in.

Please sign in to comment.