Rails5 fix connection execute return integer instead of string
This commit is contained in:
parent
6d4a0325f1
commit
cff72930a4
2 changed files with 6 additions and 1 deletions
5
changelogs/unreleased/rails5-fix-db-check.yml
Normal file
5
changelogs/unreleased/rails5-fix-db-check.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Rails5 fix connection execute return integer instead of string
|
||||
merge_request: 19901
|
||||
author: Jasper Maes
|
||||
type: fixed
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue