]> source.dussan.org Git - redmine.git/commitdiff
Merged r21059 from trunk to 4.1-stable (#35435).
authorGo MAEDA <maeda@farend.jp>
Wed, 9 Feb 2022 01:22:33 +0000 (01:22 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 9 Feb 2022 01:22:33 +0000 (01:22 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21407 e93f8b46-1217-0410-a6f0-8f06a7374b81

Gemfile

diff --git a/Gemfile b/Gemfile
index e72e7b9a1e38fdc365c0934828d68ce1ed1a27f6..bff94d45cc7dad8f853f500e1c853275af671914 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -48,7 +48,8 @@ require 'erb'
 require 'yaml'
 database_file = File.join(File.dirname(__FILE__), "config/database.yml")
 if File.exist?(database_file)
-  database_config = YAML::load(ERB.new(IO.read(database_file)).result)
+  yaml_config = ERB.new(IO.read(database_file)).result
+  database_config = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml_config) : YAML.load(yaml_config)
   adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
   if adapters.any?
     adapters.each do |adapter|