Plugins can register providers for global settings

This commit is contained in:
Robin Ward
2017-01-09 17:10:14 -05:00
parent 185dcb2ca1
commit b60bc47a4c
5 changed files with 52 additions and 29 deletions

View File

@@ -145,14 +145,14 @@ class GlobalSetting
attr_accessor :provider
end
if Rails.env == "test"
@provider = BlankProvider.new
else
@provider =
FileProvider.from(File.expand_path('../../../config/discourse.conf', __FILE__)) ||
EnvProvider.new
def self.configure!
if Rails.env == "test"
@provider = BlankProvider.new
else
@provider =
FileProvider.from(File.expand_path('../../../config/discourse.conf', __FILE__)) ||
EnvProvider.new
end
end
load_defaults
end