Module: Roqua::StatusChecks::CheckDbConnection
- Defined in:
- lib/roqua/status_checks/check_db_connection.rb
Class Method Summary collapse
Class Method Details
.connected? ⇒ Boolean
4 5 6 7 8 9 10 11 12 |
# File 'lib/roqua/status_checks/check_db_connection.rb', line 4 def self.connected? if defined?(ActiveRecord::Base.connection.database_exists?) ActiveRecord::Base.connection.database_exists? else ActiveRecord::Base.connection.active? # does not start connection on rails 7.1+ end rescue StandardError false # Check must return boolean, not an exception. end |