From ef7d9beb8e55f589d8df48e4d2ef341a752734ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Ezr?= Date: Fri, 11 Mar 2022 12:21:14 +0100 Subject: [PATCH] Setting loading --- app/services/setting_registry.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/services/setting_registry.rb b/app/services/setting_registry.rb index 17e933f7f009..2d596123fa6a 100644 --- a/app/services/setting_registry.rb +++ b/app/services/setting_registry.rb @@ -132,18 +132,9 @@ def load_definitions end end - def known_categories - unless @known_descendants == Setting.descendants - @known_descendants = Setting.descendants - @known_categories = @known_descendants.map(&:name) << 'Setting' - @values_loaded_at = nil # force all values to be reloaded - end - @known_categories - end - def load_values(ignore_cache: false) # we are loading only known STIs as we load settings fairly early the first time and plugin classes might not be loaded yet. - settings = Setting.unscoped.where(category: known_categories).where.not(value: nil) + settings = Setting.unscoped.where(category: 'Setting').where.not(value: nil) settings = settings.where('updated_at >= ?', @values_loaded_at) unless ignore_cache || @values_loaded_at.nil? settings.each do |s| unless (definition = find(s.name))