Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created March 2, 2011 20:15
Show Gist options
  • Select an option

  • Save DCarper/851649 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/851649 to your computer and use it in GitHub Desktop.
if defined?(ActiveRecord::Base)
begin
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean
rescue LoadError => ignore_if_database_cleaner_not_present
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment