Mathieu Chappuis
2005-Dec-22 15:24 UTC
[NEWB] How to access database.yml parameters in a controller
Hi, Are the active database.yaml attributes for the current environment (dev, prod, test) available inside a controler ? adapter, host, db, socks, etc. AFIK Class#connection don''t give back theses infos. Thanks
Peter Donald
2005-Dec-22 21:50 UTC
Re: [NEWB] How to access database.yml parameters in a controller
On 12/23/05, Mathieu Chappuis <mathieu.chappuis.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Are the active database.yaml attributes for the current environment > (dev, prod, test) available inside a controler ?ActiveRecord::Base.configurations[RAILS_ENV.to_sym][''database''] ActiveRecord::Base.configurations[RAILS_ENV.to_sym][''host''] ActiveRecord::Base.configurations[RAILS_ENV.to_sym][''adapter''] -- Cheers, Peter Donald Blog: RealityForge.org