Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add truncate_table plugin

  • Loading branch information...
commit 98e7c8d532ac22dc0646ee56ae6a736bddc91932 1 parent 5888b87
@pythonic pythonic authored
View
1  vendor/plugins/truncate_table/init.rb
@@ -0,0 +1 @@
+require File.join(File.dirname(__FILE__), "lib", "truncate_table.rb")
View
12 vendor/plugins/truncate_table/lib/truncate_table.rb
@@ -0,0 +1,12 @@
+# encoding: UTF-8
+
+module TruncateTable
+ module Base
+ def truncate
+ connection.execute "TRUNCATE TABLE #{table_name};"
+ nil
+ end
+ end
+end
+
+ActiveRecord::Base.send :extend, TruncateTable::Base
Please sign in to comment.
Something went wrong with that request. Please try again.