Load plugin settings.

Along the lines for loading the locale files for a plugin we should also load the settings.yml for a plugin.
This commit is contained in:
Erik Ordway 2013-11-19 09:58:45 -08:00
parent 58b275665b
commit 04f3e09854
1 changed files with 10 additions and 0 deletions

View File

@ -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