diff options
author | Rémy Coutable <remy@rymai.me> | 2016-01-26 15:11:15 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-01-26 15:11:15 +0100 |
commit | e6f3fe5d3b16809634dd655b3d265c683b538b12 (patch) | |
tree | a4849d406b810356f3f8b61ee5074c5620b8074a /lib/api/commit_statuses.rb | |
parent | cd22da3ebda969779c47f1652f3876daa5edd7f2 (diff) | |
download | gitlab-ce-e6f3fe5d3b16809634dd655b3d265c683b538b12.tar.gz |
Ensure rake tasks that don't need a DB connection can be run without one
When using ActiveRecord::Base.connection.active? without a DB
connection, we get a "PG::ConnectionBad: could not connect to server"
error because ActiveRecord::Base.connection doesn't exist. By using
ActiveRecord::Base.connected? we ensure we don't get this error if
the connection is missing, which is the all point of the
Gitlab::CurrentSettings#connect_to_db? method!
Diffstat (limited to 'lib/api/commit_statuses.rb')
0 files changed, 0 insertions, 0 deletions