summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-06-18 12:44:44 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2018-06-18 12:44:44 +0000
commit7849fd36950f9eae65110b8482afba0f24e5357d (patch)
tree37eed80af43cac8ec7edac7ff2cbcc46f149e61c
parent88442e02e744f730282b5d9eec93b8dd1c1768bb (diff)
parentcff72930a4806c3aa5c324b2b5bc274c5c6d2581 (diff)
downloadgitlab-ce-7849fd36950f9eae65110b8482afba0f24e5357d.tar.gz
Merge branch 'rails5-fix-db-check' into 'master'
Rails5 fix db check: connection execute returns integer instead of string See merge request gitlab-org/gitlab-ce!19901
-rw-r--r--changelogs/unreleased/rails5-fix-db-check.yml5
-rw-r--r--lib/gitlab/health_checks/db_check.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/changelogs/unreleased/rails5-fix-db-check.yml b/changelogs/unreleased/rails5-fix-db-check.yml
new file mode 100644
index 00000000000..ccac4619ea7
--- /dev/null
+++ b/changelogs/unreleased/rails5-fix-db-check.yml
@@ -0,0 +1,5 @@
+---
+title: Rails5 fix connection execute return integer instead of string
+merge_request: 19901
+author: Jasper Maes
+type: fixed
diff --git a/lib/gitlab/health_checks/db_check.rb b/lib/gitlab/health_checks/db_check.rb
index e27e16ddaf6..08495c0a59e 100644
--- a/lib/gitlab/health_checks/db_check.rb
+++ b/lib/gitlab/health_checks/db_check.rb
@@ -17,7 +17,7 @@ module Gitlab
def check
catch_timeout 10.seconds do
if Gitlab::Database.postgresql?
- ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping')
+ ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping')&.to_s
else
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.first&.to_s
end