From 3f9425277f6e5ac5c31572b811ed641a5334646e Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 6 Dec 2021 17:38:19 +0100 Subject: [PATCH] Improve documentation of PingController --- app/controllers/ping_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/ping_controller.rb b/app/controllers/ping_controller.rb index 3373da09..8ba2a7ad 100644 --- a/app/controllers/ping_controller.rb +++ b/app/controllers/ping_controller.rb @@ -15,8 +15,9 @@ class PingController < ApplicationController private def postgres_connected! + # any unhandled exception leads to a HTTP 500 response. ApplicationRecord.establish_connection ApplicationRecord.connection - ApplicationRecord.connected? + raise ActiveRecord::ConnectionNotEstablished unless ApplicationRecord.connected? end end