How to detect a new database?

33 views
Skip to first unread message

Roman Gaufman

unread,
Mar 20, 2014, 6:50:30 AM3/20/14
to mon...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages