You can access all the properties described in your database.yaml file:
ActiveRecord::Base.configurations["development"] =>
{"encoding"=>"utf8", "username"=>"foo", "adapter"=>"mysql", "database"=>"bar_development", "host"=>"localhost", "password"=> "baz"}
source
share