]> source.dussan.org Git - redmine.git/commitdiff
Refactor code to use YAML.load_file instead of explicitly opening the file (#38250).
authorGo MAEDA <maeda@farend.jp>
Mon, 13 Feb 2023 14:35:38 +0000 (14:35 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 13 Feb 2023 14:35:38 +0000 (14:35 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22101 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/setting.rb

index 1b73d7c1f953712ada4e3eb66a1a30d248deff6f..155ed23b162ff8fdbee740021591341ccc0310b6 100644 (file)
@@ -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