diff options
author | Go MAEDA <maeda@farend.jp> | 2023-02-13 14:35:38 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-02-13 14:35:38 +0000 |
commit | 45b4bff194e8cecdbd2cd1527326f7c5b3cc32be (patch) | |
tree | 5d8a1215ffb46da44820393dda072e5c6fdcd9c0 /app | |
parent | c94296720d191487aa903b7cb0e27e52e37344c8 (diff) | |
download | redmine-45b4bff194e8cecdbd2cd1527326f7c5b3cc32be.tar.gz redmine-45b4bff194e8cecdbd2cd1527326f7c5b3cc32be.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/setting.rb | 6 |
1 files 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 |