How to programmatically get the current database Mongoid is writing to?
If you want the overrided database you actually need to use
Mongoid::Threaded.database_override
The new way to get this is
Mongoid::Config.clients["default"]["database"]
You can also just have a look at
Mongoid::Config.clients
to see what else is available.
Got it!
Mongoid.default_session.options[:database]