mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 18:54:44 +08:00
FIX: Do not cache translated trust level names in site settings (#11863)
There's no real need to cache these, and the caching can introduce problems when different sites/users are using different locales.
This commit is contained in:
@ -9,7 +9,7 @@ class TrustLevelSetting < EnumSiteSetting
|
|||||||
|
|
||||||
def self.values
|
def self.values
|
||||||
levels = TrustLevel.all
|
levels = TrustLevel.all
|
||||||
@values ||= valid_values.map { |x|
|
valid_values.map { |x|
|
||||||
{
|
{
|
||||||
name: x.is_a?(Integer) ? "#{x}: #{levels[x.to_i].name}" : x,
|
name: x.is_a?(Integer) ? "#{x}: #{levels[x.to_i].name}" : x,
|
||||||
value: x
|
value: x
|
||||||
|
Reference in New Issue
Block a user