Commit 75fb9ee

mo khan <mo@mokhan.ca>
2015-06-06 03:32:56
reconnect to active record on worker boot.
1 parent d4e4525
Changed files (2)
config/puma_production.rb
@@ -23,7 +23,7 @@ state_path "#{rails_root}/tmp/pids/puma.state"
 activate_control_app
 
 on_worker_boot do
-  require "active_record"
-  ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
-  ActiveRecord::Base.establish_connection(YAML.load_file("#{rails_root}/config/database.yml")[rails_env])
+  # 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
 end
Gemfile.lock
@@ -374,4 +374,4 @@ DEPENDENCIES
   web-console (~> 2.0)
 
 BUNDLED WITH
-   1.10.1
+   1.10.3