How to get database.yml configuration to use it in a rake ta



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


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.)

Anthony EDen

On 12/23/06, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

Aníbal Rojas

Cell: 808 782-5046
Current Location: Melbourne, FL