Created
June 16, 2011 20:00
-
-
Save kronn/1030123 to your computer and use it in GitHub Desktop.
In case you need to change Database config mid-flight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.connection_pool.disconnect! | |
ActiveRecord::Base.connection_handler.remove_connection(ActiveRecord::Base) | |
Rails.application.config.database = new_database_config # not strictly necessary | |
ActiveRecord::Base.configurations = new_database_config | |
ActiveRecord::Base.establish_connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment