Created
May 30, 2012 09:44
-
-
Save sandinist/2835165 to your computer and use it in GitHub Desktop.
truncate tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tables = (ActiveRecord::Base.connection.tables - %w{schema_migrations}) | |
tables.each {|table| | |
ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table};") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment