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


    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,

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