From 45b4bff194e8cecdbd2cd1527326f7c5b3cc32be Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 13 Feb 2023 14:35:38 +0000 Subject: [PATCH] Refactor code to use YAML.load_file instead of explicitly opening the file (#38250). git-svn-id: https://svn.redmine.org/redmine/trunk@22101 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/setting.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/setting.rb b/app/models/setting.rb index 1b73d7c1f..155ed23b1 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -320,10 +320,8 @@ class Setting < ActiveRecord::Base end def self.load_available_settings - File.open("#{Rails.root}/config/settings.yml") do |f| - YAML.load(f).each do |name, options| - define_setting name, options - end + YAML.load_file(Rails.root.join('config/settings.yml')).each do |name, options| + define_setting name, options end end -- 2.39.5