mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-20 20:42:44 -05:00
666264879c
this cleans up a bunch of internals and removes some settings
35 lines
681 B
Ruby
35 lines
681 B
Ruby
module SiteSettings; end
|
|
|
|
class SiteSettings::LocalProcessProvider
|
|
|
|
Setting = Struct.new(:name, :value, :data_type) unless defined? SiteSettings::LocalProcessProvider::Setting
|
|
|
|
def initialize(defaults = {})
|
|
@settings = {}
|
|
@defaults = {}
|
|
defaults.each do |name,(value,data_type)|
|
|
@defaults[name] = Setting.new(name,value,data_type)
|
|
end
|
|
end
|
|
|
|
def all
|
|
(@defaults.merge @settings).values
|
|
end
|
|
|
|
def find(name)
|
|
@settings[name] || @defaults[name]
|
|
end
|
|
|
|
def save(name, value, data_type)
|
|
@settings[name] = Setting.new(name,value, data_type)
|
|
end
|
|
|
|
def destroy(name)
|
|
@settings.delete(name)
|
|
end
|
|
|
|
def current_site
|
|
"test"
|
|
end
|
|
|
|
end
|