Created
March 21, 2011 02:58
-
-
Save devton/878944 to your computer and use it in GitHub Desktop.
Clear mongodb collection in end of the each
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.after(:each) do | |
puts "cleaning mongodb...." | |
Mongoid.database.collections.each do |collection| | |
unless collection.name =~ /^system\./ | |
collection.remove | |
end | |
end | |
puts "finished cleaning mongodb." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment