Search code examples
ruby-on-railsdatabase-cleaner

Is it possible for DatabaseCleaner to not reset a given table?


Does Database Cleaner support a way to reset all tables except a given table?


Solution

  • It should work:

    DatabaseCleaner.clean_with(:truncation, :except => %w[users])