How to mongoid create an index for a test and production environment

How does mongoid create an index for a test and production environment? I mean

     rake db:mongoid:create_indexes => environment

How to set up the environment?

I use mangoid 2.4.9 and rails 3.2.7.

+5
source share
1 answer

As in other rake tasks for Rails, just specify RAILS_ENV for the rake on the command line, for example.

rake db:mongoid:create_indexes RAILS_ENV=test

You can pin your log files in another window to see how this happens.

tail -f log/*.log
+8
source

All Articles