From: Tom Hughes Date: Sat, 23 Mar 2019 11:59:42 +0000 (+0000) Subject: Use strings consistently for database/api/gpx status X-Git-Tag: live~3228 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/cba7945a5b409222301f7512e648866810cae4d9?ds=inline;hp=-c Use strings consistently for database/api/gpx status --- cba7945a5b409222301f7512e648866810cae4d9 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8d9ee11f9..fb5614236 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -147,14 +147,14 @@ class ApplicationController < ActionController::Base end def check_api_readable - if api_status == :offline + if api_status == "offline" report_error "Database offline for maintenance", :service_unavailable false end end def check_api_writable - unless api_status == :online + unless api_status == "online" report_error "Database offline for maintenance", :service_unavailable false end @@ -162,21 +162,21 @@ class ApplicationController < ActionController::Base def database_status if Settings.status == "database_offline" - :offline + "offline" elsif Settings.status == "database_readonly" - :readonly + "readonly" else - :online + "online" end end def api_status status = database_status - if status == :online + if status == "online" if Settings.status == "api_offline" - status = :offline + status = "offline" elsif Settings.status == "api_readonly" - status = :readonly + status = "readonly" end end status @@ -184,7 +184,7 @@ class ApplicationController < ActionController::Base def gpx_status status = database_status - status = :offline if status == :online && Settings.status == "gpx_offline" + status = "offline" if status == "online" && Settings.status == "gpx_offline" status end