From: Go MAEDA Date: Mon, 13 Feb 2023 14:35:38 +0000 (+0000) Subject: Refactor code to use YAML.load_file instead of explicitly opening the file (#38250). X-Git-Tag: 5.1.0~244 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45b4bff194e8cecdbd2cd1527326f7c5b3cc32be;p=redmine.git 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 --- 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