commit
9de07fd83f
|
@ -7,14 +7,23 @@ class SiteSetting < ActiveRecord::Base
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
validates_presence_of :data_type
|
validates_presence_of :data_type
|
||||||
|
|
||||||
SiteSettings::YamlLoader.new( File.join( Rails.root, 'config', 'site_settings.yml') ).load do |category, name, default, opts|
|
def self.load_settings(file)
|
||||||
if opts.delete(:client)
|
SiteSettings::YamlLoader.new(file).load do |category, name, default, opts|
|
||||||
client_setting(name, default, opts.merge(category: category))
|
if opts.delete(:client)
|
||||||
else
|
client_setting(name, default, opts.merge(category: category))
|
||||||
setting(name, default, opts.merge(category: category))
|
else
|
||||||
|
setting(name, default, opts.merge(category: category))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
load_settings(File.join(Rails.root, 'config', 'site_settings.yml'))
|
||||||
|
|
||||||
|
Dir[File.join(Rails.root, "plugins", "*", "config", "settings.yml")].each do |file|
|
||||||
|
load_settings(file)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.call_discourse_hub?
|
def self.call_discourse_hub?
|
||||||
self.enforce_global_nicknames? && self.discourse_org_access_key.present?
|
self.enforce_global_nicknames? && self.discourse_org_access_key.present?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue