jnunemaker/mongomapper — Issue #337: Document best practices for ensure_index
Author: kylev
Created: 2011-11-02 01:06:45+00:00
State: open

Right now I'm putting "ensure_index" statements right in my models, but this seems likely to cause problems (or at least a lot of no-ops). How are people using ensure_index? Do they call it from a rake task post-deploy? Put it in an initializer and hope everyone remembers to set ":background => true" or suffer blocking deploy hell?

It seems like a pretty important topic for it to be utterly absent from the docs.