Use ActiveRecord::Base.connection.active? and rescue any exception in connect_to_db?
This ensures that rake tasks that don't need a DB connection can be run without one.
Showing
Please register or sign in to comment
This ensures that rake tasks that don't need a DB connection can be run without one.