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:
David Taylor 2019-01-16 12:04:12 +00:00
parent 9703fa2abc
commit b46b6e72d1
1 changed files with 6 additions and 1 deletions

View File

@ -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