Get config hash for active connection


#1

Hi,

I want to use establish_connection for one of my classes, but I just
want to change the user and password, and keep the current connection
adapter and host.

I can call ActiveRecord::Base.connection to get the adapter object,
but I dont find how to extract the initial hash out of it.

How can I do that ?

Thx


#2

abcs = ActiveRecord::Base.configurations
db_name = abcs[RAILS_ENV][“database”]

and so on…

Jean-Etienne
http://www.woa.hu