diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-11 23:51:30 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-11 23:58:04 +0100 |
commit | 80e18e759e5244bbffd637e306f4f18b92af5caf (patch) | |
tree | 54ea8db1b8d1d47dde2cabf1bd202284171db9b6 /railties/lib/commands | |
parent | 236f0bb67adecbc1e6dac5258e4a8cb310ffd7a4 (diff) | |
download | rails-80e18e759e5244bbffd637e306f4f18b92af5caf.tar.gz rails-80e18e759e5244bbffd637e306f4f18b92af5caf.tar.bz2 rails-80e18e759e5244bbffd637e306f4f18b92af5caf.zip |
Ensure dbconsole respects erb in database.yml. [#157 state:resolved] [Andrew Bennett]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib/commands')
-rw-r--r-- | railties/lib/commands/dbconsole.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb index 28c3a3e41f..3e5010c688 100644 --- a/railties/lib/commands/dbconsole.rb +++ b/railties/lib/commands/dbconsole.rb @@ -1,3 +1,4 @@ +require 'erb' require 'yaml' require 'optparse' @@ -8,7 +9,7 @@ OptionParser.new do |opt| end env = ARGV.first || ENV['RAILS_ENV'] || 'development' -unless config = YAML.load_file(RAILS_ROOT + "/config/database.yml")[env] +unless config = YAML::load(ERB.new(IO.read(RAILS_ROOT + "/config/database.yml")).result)[env] abort "No database is configured for the environment '#{env}'" end |