summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-06-15 19:04:02 +0200
committerJasper Maes <jaspermaes.jm@gmail.com>2018-06-15 19:15:59 +0200
commitcff72930a4806c3aa5c324b2b5bc274c5c6d2581 (patch)
tree7638484300b39b731364e3d6d0baa764b8d663a4
parent6d4a0325f13069fd5c69a3a6520de73f67783200 (diff)
downloadgitlab-ce-cff72930a4806c3aa5c324b2b5bc274c5c6d2581.tar.gz
Rails5 fix connection execute return integer instead of string
-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