mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 01:53:45 +08:00
3f24ed2b3e
Revert "Revert "FEATURE: Site settings defaults per locale""
This reverts commit 439fe8ba24
.
27 lines
1.0 KiB
Ruby
27 lines
1.0 KiB
Ruby
module SiteSettings; end
|
|
|
|
module SiteSettings::DeprecatedSettings
|
|
DEPRECATED_SETTINGS = [
|
|
%w[use_https force_https 1.7]
|
|
]
|
|
|
|
def setup_deprecated_methods
|
|
DEPRECATED_SETTINGS.each do |old_setting, new_setting, version|
|
|
define_singleton_method old_setting do
|
|
logger.warn("`SiteSetting.#{old_setting}` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting.#{new_setting}` instead")
|
|
self.public_send new_setting
|
|
end
|
|
|
|
define_singleton_method "#{old_setting}?" do
|
|
logger.warn("`SiteSetting.#{old_setting}?` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting.#{new_setting}?` instead")
|
|
self.public_send "#{new_setting}?"
|
|
end
|
|
|
|
define_singleton_method "#{old_setting}=" do |val|
|
|
logger.warn("`SiteSetting.#{old_setting}=` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting.#{new_setting}=` instead")
|
|
self.public_send "#{new_setting}=", val
|
|
end
|
|
end
|
|
end
|
|
end
|