FIX: Incorrect deprecation message.

This commit is contained in:
Guo Xiang Tan 2016-07-01 01:18:57 +08:00
parent aa4dccd0a1
commit b66fc72c18
No known key found for this signature in database
GPG key ID: 19C321C8952B0F72

View file

@ -457,17 +457,17 @@ module SiteSettingExtension
def setup_deprecated_methods def setup_deprecated_methods
DEPRECATED_SETTINGS.each do |old_setting, new_setting, version| DEPRECATED_SETTINGS.each do |old_setting, new_setting, version|
define_singleton_method old_setting do define_singleton_method old_setting do
logger.warn("`SiteSetting##{name}` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting##{new_setting}` instead") 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 self.public_send new_setting
end end
define_singleton_method "#{old_setting}?" do define_singleton_method "#{old_setting}?" do
logger.warn("`SiteSetting##{name}?` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting##{new_setting}?` instead") 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}?" self.public_send "#{new_setting}?"
end end
define_singleton_method "#{old_setting}=" do |val| define_singleton_method "#{old_setting}=" do |val|
logger.warn("`SiteSetting##{name}=` has been deprecated and will be removed in the #{version} Release. Please use `SiteSetting##{new_setting}=` instead") 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 self.public_send "#{new_setting}=", val
end end
end end