Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rails Multi-Database Best Practices Roundup - config/initializers/passenger.rb - http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
ActiveRecord::Base.clear_all_connections!
MysqlBase.establish_connection MysqlBase.configurations['mysql'][Rails.env]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.