mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
DEV: introduce new API to look up dynamic site setting
This removes all uses of both `send` and `public_send` from consumers of SiteSetting and instead introduces a `get` helper for dynamic lookup This leads to much cleaner and safer code long term as we are always explicit to test that a site setting is really there before sending an arbitrary string to the class It also removes a couple of risky stubs from the auth provider test
This commit is contained in:
@ -123,7 +123,7 @@ class Validators::UploadValidator < ActiveModel::Validator
|
||||
max_size_kb = if upload.for_export
|
||||
SiteSetting.max_export_file_size_kb
|
||||
else
|
||||
SiteSetting.send("max_#{type}_size_kb")
|
||||
SiteSetting.get("max_#{type}_size_kb")
|
||||
end
|
||||
max_size_bytes = max_size_kb.kilobytes
|
||||
|
||||
|
Reference in New Issue
Block a user