If the DB server is down when the rails server starts, or if it gets
down while the rails server is running, I need to
- detect the problem
- display a simple error message “DB is down: contact support”.
at the very begining of ApplicationController will trigger an error -
that can be captured - when the class is loaded, but before the
controller is instantiated => cannot render anything.
And it would not help if the DB gets down after the app has been running
(and the controller has been cached).
How can I solve this problem?
Thanks in advance.