DatabaseCleaner / database_cleaner-active_record

Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
MIT License
64 stars 63 forks source link

Reset ids option #71

Closed Crammaman closed 1 year ago

Crammaman commented 2 years ago

Implement resetting ids for deletion strategy.

Crammaman commented 2 years ago

Early in our projects life someone switched the strategy over to truncation, which resets the ids but is slow. Implementing this allows us to swap over to the much faster deletion strategy without going through the rather monumental task of getting the specs to work with the ids not resetting.