diff --git a/config/puma.rb b/config/puma.rb index 325436648..0aa72dba9 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -7,3 +7,9 @@ rackup DefaultRackup if defined?(DefaultRackup) port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' + +on_worker_boot do + # Worker-specific setup for Rails 4.1 to 5.2, after 5.2 it's not needed + # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot + ActiveRecord::Base.establish_connection +end