Revert "FEATURE: Site settings defaults per locale"

This reverts commit 468a8fcd206d14ff4421758e840d63a27c246254.
This commit is contained in:
Guo Xiang Tan
2017-08-07 10:31:50 +09:00
parent 4b53fe3cc7
commit 439fe8ba24
28 changed files with 364 additions and 1373 deletions

View File

@ -14,7 +14,11 @@ class SiteSetting < ActiveRecord::Base
def self.load_settings(file)
SiteSettings::YamlLoader.new(file).load do |category, name, default, opts|
setting(name, default, opts.merge(category: category))
if opts.delete(:client)
client_setting(name, default, opts.merge(category: category))
else
setting(name, default, opts.merge(category: category))
end
end
end
@ -27,11 +31,6 @@ class SiteSetting < ActiveRecord::Base
end
end
# `current` hash is not populated everytime when load a site setting
# in order to support locale default. Instead, we simply `refresh!` once.
# This should only affects the spec in which you should populate `current`
refresh!
client_settings << :available_locales
def self.available_locales