public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Ensure dbconsole respects erb in database.yml. [#157 state:resolved] 
[Andrew Bennett]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
lifo (author)
Sun May 11 15:51:30 -0700 2008
commit  80e18e759e5244bbffd637e306f4f18b92af5caf
tree    54ea8db1b8d1d47dde2cabf1bd202284171db9b6
parent  236f0bb67adecbc1e6dac5258e4a8cb310ffd7a4
...
 
1
2
3
...
8
9
10
11
 
12
13
14
...
1
2
3
4
...
9
10
11
 
12
13
14
15
0
@@ -1,3 +1,4 @@
0
+require 'erb'
0
 require 'yaml'
0
 require 'optparse'
0
 
0
@@ -8,7 +9,7 @@ OptionParser.new do |opt|
0
 end
0
 
0
 env = ARGV.first || ENV['RAILS_ENV'] || 'development'
0
-unless config = YAML.load_file(RAILS_ROOT + "/config/database.yml")[env]
0
+unless config = YAML::load(ERB.new(IO.read(RAILS_ROOT + "/config/database.yml")).result)[env]
0
   abort "No database is configured for the environment '#{env}'"
0
 end
0
 

Comments

    No one has commented yet.