FIX: Only add the trust level name for numeric trust levels
Previously the TrustLevelAndStaffSetting would display 'new user' for staff/admin
This commit is contained in:
parent
9703fa2abc
commit
b46b6e72d1
|
@ -9,7 +9,12 @@ class TrustLevelSetting < EnumSiteSetting
|
|||
|
||||
def self.values
|
||||
levels = TrustLevel.all
|
||||
@values ||= valid_values.map { |x| { name: "#{x}: #{levels[x.to_i].name}", value: x } }
|
||||
@values ||= valid_values.map { |x|
|
||||
{
|
||||
name: x.is_a?(Integer) ? "#{x}: #{levels[x.to_i].name}" : x,
|
||||
value: x
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def self.valid_values
|
||||
|
|
Loading…
Reference in New Issue