mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:45:26 +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:
@ -1433,7 +1433,7 @@ class Topic < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def apply_per_day_rate_limit_for(key, method_name)
|
||||
RateLimiter.new(user, "#{key}-per-day", SiteSetting.send(method_name), 1.day.to_i)
|
||||
RateLimiter.new(user, "#{key}-per-day", SiteSetting.get(method_name), 1.day.to_i)
|
||||
end
|
||||
|
||||
def create_invite_notification!(target_user, notification_type, username)
|
||||
|
Reference in New Issue
Block a user