for mongoid, since it doesn't support rake db:migrate and rake db:drop will drop all tables, so if we need to drop some of tables in database, I will the following code.
1. [color=blue]rails g task db droptables[/color]
2. in lib/tasks/db.rake file
1. [color=blue]rails g task db droptables[/color]
2. in lib/tasks/db.rake file
namespace :db do
desc "drop some seed tables"
task droptables: :environment do
Table1.destroy_all
Table2.destroy_all
Table3.destroy_all
...
end
end