DEV: Drop env-based SiteSetting deprecation errors (#15273)

These were deprecated ~4 years ago. No need to keep the errors anymore.
This commit is contained in:
Jarek Radosz 2021-12-13 17:36:29 +01:00 committed by GitHub
parent cf84f85f3e
commit 42015fe8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -15,16 +15,10 @@ class SiteSettings::YamlLoader
# Get default value for the site setting:
value = hash.delete('default')
if value.is_a?(Hash)
raise Discourse::Deprecation, "The site setting `#{setting_name}` can no longer be set based on Rails environment. See also `config/environments/<env>.rb`."
elsif value.nil?
if value.nil?
raise StandardError, "The site setting `#{setting_name}` in '#{@file}' is missing default value."
end
if hash['hidden']&.is_a?(Hash)
raise Discourse::Deprecation, "The site setting `#{setting_name}`'s hidden property can no longer be set based on Rails environment. It can only be either `true` or `false`."
end
yield category, setting_name, value, hash.deep_symbolize_keys!
else
# Simplest case. site_setting_name: 'default value'

View File

@ -72,14 +72,6 @@ describe SiteSettings::YamlLoader do
receiver.load_yaml(enum_client)
end
it "raises deprecation when load settings based on environment" do
expect { receiver.load_yaml(deprecated_env) }.to raise_error(Discourse::Deprecation)
end
it "raises deprecation when hidden property is based on environment" do
expect { receiver.load_yaml(deprecated_hidden) }.to raise_error(Discourse::Deprecation)
end
it "raises invalid parameter when default value is not present" do
expect { receiver.load_yaml(nil_default) }.to raise_error(StandardError)
end