Forum: Ruby on Rails Get config hash for active connection

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bartocc (Guest)
on 2007-05-29 17:52
(Received via mailing list)

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 ?

Jean-Etienne D. (Guest)
on 2007-05-29 18:49
abcs = ActiveRecord::Base.configurations
db_name = abcs[RAILS_ENV]["database"]

and so on...

This topic is locked and can not be replied to.