Forum: Ruby on Rails How to get database.yml configuration to use it in a rake ta

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-12-31 01:40
(Received via mailing list)
Hello,

    I want to get the production environment configuration from the
database.yml in the /shared folder of a deployed rails application. I
could use scp to get the file, write it to temporary file, read it and
open it with  YAML, but is there a better way to do this?

    Best regards,

--
Aníbal Rojas
http://www.rubycorner.com
http://www.hasmanydevelopers.com
Anthony E. (Guest)
on 2006-12-31 03:05
(Received via mailing list)
You can get at the configurations with
ActiveRecord::Base.configurations, which is a hash where each key is
the environment name and which maps to a hash of the configuration
options (i.e. hostname, port, username, password, etc.)

V/r
Anthony EDen

On 12/23/06, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid> wrote:
> --
> Aníbal Rojas
> http://www.rubycorner.com
> http://www.hasmanydevelopers.com
>
>
> >
>


--
Cell: 808 782-5046
Current Location: Melbourne, FL
This topic is locked and can not be replied to.