To get the database configuration of all environments, run in a Rails console:
Rails.configuration.database_configurationTo get the database name ActiveRecord is going to use:
ActiveRecord::Base.connection.current_databaseYou can also use a specific model (useful if you have different models connecting to different databases):
Cat.connection.current_database