summaryrefslogtreecommitdiffstats
path: root/Gemfile
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-29 18:02:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-29 18:02:20 +0000
commitb0f496a58d4ecc149737448d231a24d707028674 (patch)
treeff5d55fb4fad8fbbac5064952c355e88006fc184 /Gemfile
parent1e0a94de84197825e34c3dd01e5b2ef6112963d9 (diff)
downloadredmine-b0f496a58d4ecc149737448d231a24d707028674.tar.gz
redmine-b0f496a58d4ecc149737448d231a24d707028674.zip
Parse database.yml with erb (#13004).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11286 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'Gemfile')
-rw-r--r--Gemfile3
1 files changed, 2 insertions, 1 deletions
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|