This blog is part of our Rails 6 series.
Rails 6.0.0.beta3 was recently released.
Rails 6 changed return value of ActiveRecord::Base.configurations to an object of
ActiveRecord::DatabaseConfigurations. Before Rails 6, ActiveRecord::Base.configurations returned a hash with all the database configurations. We can call
to_h on object of
ActiveRecord::DatabaseConfigurations to get a hash.
A method named as configs_for has also been added on to fetch configurations for a particular environment.
Here is the relevant