Accessing Mongoid database outside of controllers

How can I access the MongoDB using Mongoid outside of controllers?
I have a ruby script that gets started at rails init time and I want it
have access to the database.
The script is spawned from the config/initializers directory.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs