Rails - Clear table and reset auto_increment
A little memo to remember how to do this found on stackoverflow (cf. http://stackoverflow.com/a/13173994 ):
Model.destroy_all
ActiveRecord::Base.connection.execute("TRUNCATE table_name")
Written by chuck
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#