Created
September 4, 2014 23:13
-
-
Save thelinuxlich/e095d45d8582d6a2c6e4 to your computer and use it in GitHub Desktop.
puma.rb
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
threads 3, 3 | |
workers 2 | |
on_worker_boot do | |
require "active_record" | |
require "erb" | |
cwd = File.dirname(__FILE__)+"/.." | |
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished | |
configuration = YAML.load(ERB.new(File.read("#{cwd}/config/database.yml")).result) | |
ActiveRecord::Base.establish_connection(configuration[ENV["RAILS_ENV"]]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment