From b0f496a58d4ecc149737448d231a24d707028674 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 29 Jan 2013 18:02:20 +0000 Subject: [PATCH] Parse database.yml with erb (#13004). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11286 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e82523cba..cc03f1928 100644 --- a/Gemfile +++ b/Gemfile @@ -36,9 +36,10 @@ end # Include database gems for the adapters found in the database # configuration file +require 'erb' database_file = File.join(File.dirname(__FILE__), "config/database.yml") if File.exist?(database_file) - database_config = YAML.load_file(database_file) + database_config = YAML::load(ERB.new(IO.read(database_file)).result) adapters = database_config.values.map {|c| c['adapter']}.compact.uniq if adapters.any? adapters.each do |adapter|