rails, activerecord, get current connection specification

Similar to the way that you can call connection on a model, you can make a call to connection on ActiveRecord::Base.


Look at the docs for ActiveRecord::Base, as there are other methods that allow you to get/set attributes about the connection.


The connection_config became deprecated and will be removed from Rails 6.2. connection_db_config should be used instead:


Leave a Comment