Commit 4595f95
Changed files (1)
config
config/puma_production.rb
@@ -23,7 +23,7 @@ state_path "#{rails_root}/tmp/pids/puma.state"
activate_control_app
on_worker_boot do
- # Worker specific setup for Rails 4.1+
- # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
- ActiveRecord::Base.establish_connection
+ require "active_record"
+ ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
+ ActiveRecord::Base.establish_connection(YAML.load_file("#{rails_root}/config/database.yml")[rails_env])
end