diff options
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 |