mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +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:
@ -1351,7 +1351,7 @@ class User < ActiveRecord::Base
|
||||
values = []
|
||||
|
||||
%w{watching watching_first_post tracking muted}.each do |s|
|
||||
category_ids = SiteSetting.send("default_categories_#{s}").split("|")
|
||||
category_ids = SiteSetting.get("default_categories_#{s}").split("|")
|
||||
category_ids.each do |category_id|
|
||||
values << "(#{self.id}, #{category_id}, #{CategoryUser.notification_levels[s.to_sym]})"
|
||||
end
|
||||
|
Reference in New Issue
Block a user