Skip to content

Commit

Permalink
Ensure dbconsole respects erb in database.yml. [#157 state:resolved] …
Browse files Browse the repository at this point in the history
…[Andrew Bennett]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
lifo committed May 11, 2008
1 parent 236f0bb commit 80e18e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/commands/dbconsole.rb
@@ -1,3 +1,4 @@
require 'erb'
require 'yaml'
require 'optparse'

Expand All @@ -8,7 +9,7 @@
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

Expand Down

0 comments on commit 80e18e7

Please sign in to comment.