Commit 4595f95

mo khan <mo@mokhan.ca>
2015-06-06 04:18:12
fix puma config.
1 parent 2b27ea5
Changed files (1)
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