app/controllers/api/v1/status_controller.rb
# Attempts to connect to the database defined in the config/environment and
# returns an OK or ERROR status whether the connection is successful or not.
Attempts to connect to the database defined in the config/environment and
returns an OK or ERROR status whether the connection is successful or not.
Attempts to connect to the database defined in the config / environment and returns an OK or ERROR status whether the connection is successful or not .
def check_database
        begin
          ActiveRecord::Base.establish_connection
          ActiveRecord::Base.connection
          db_status = "OK" if ActiveRecord::Base.connected?
          db_status = "ERROR" unless ActiveRecord::Base.connected?
        end
        db_status
      end
def check_database begin ActiveRecord :: Base . establish_connection ActiveRecord :: Base . connection db_status = "OK" if ActiveRecord :: Base . connected? db_status = "ERROR" unless ActiveRecord :: Base . connected? end db_status end
Attempts to connect to the database defined in the config/environment and
returns an OK or ERROR status whether the connection is successful or not.
Attempts to connect to the database defined in the config / environment and returns an OK or ERROR status whether the connection is successful or not .