Skip to content

Instantly share code, notes, and snippets.

@anggiaj
Created August 30, 2016 13:36
Show Gist options
  • Save anggiaj/9d5a949d6bbcd48595c6b0db5401e24b to your computer and use it in GitHub Desktop.
Save anggiaj/9d5a949d6bbcd48595c6b0db5401e24b to your computer and use it in GitHub Desktop.
ActiveRecord::Base.connection.tables.collect{|table_name| ActiveRecord::Base.connection.execute("TRUNCATE #{table_name} RESTART IDENTITY")}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment