Skip to content

Adds a truncate class method to ActiveRecord which deletes all records and resets the autoincrement ID

Notifications You must be signed in to change notification settings

simon-engledew/truncate-active-record

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Truncate Active Record
======================
                                                                 
Opens up the SQLite3 connection adapter and adds a truncate method which behaves similarly to the SQL truncate command, deleting all records in the database and resetting the auto-increment ID.
Returns the number of deleted records.

Example
=======

Post.truncate
=> 4


Copyright (c) 2008 Simon Engledew, released under the MIT license

About

Adds a truncate class method to ActiveRecord which deletes all records and resets the autoincrement ID

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages