I have an app that switches databases based on subdomain like so:
Rails.logger.debug "Switching Database to #{database_name}"
Mongoid.override_database( "#{portal}_#{env}")
This works great, except I need to detect if the database already exists or not. Is there any way to check if the database I am switching to exists or not?
Thank you for your time,
Roman