Ensure dbconsole respects erb in database.yml. [#157 state:resolved] [Andrew Bennett]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
parent
236f0bb67a
commit
80e18e759e
@ -1,3 +1,4 @@
|
||||
require 'erb'
|
||||
require 'yaml'
|
||||
require 'optparse'
|
||||
|
||||
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user