From 04f3e09854e4271132a05534180c9e9fe986b02c Mon Sep 17 00:00:00 2001 From: Erik Ordway Date: Tue, 19 Nov 2013 09:58:45 -0800 Subject: [PATCH] Load plugin settings. Along the lines for loading the locale files for a plugin we should also load the settings.yml for a plugin. --- app/models/site_setting.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index d78d18c0274..bb06042ff6f 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -15,6 +15,16 @@ class SiteSetting < ActiveRecord::Base end end + Dir["#{Rails.root}/plugins/*/config/settings.yml"].each do |plugin_settings| + SiteSettings::YamlLoader.new(plugin_settings).load do |category, name, default, opts| + if opts.delete(:client) + client_setting(name, default, opts.merge(category: category)) + else + setting(name, default, opts.merge(category: category)) + end + end + end + def self.call_discourse_hub? self.enforce_global_nicknames? && self.discourse_org_access_key.present? end