mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
59d04c0695
Changed internals so trust levels are referred to with TrustLevel[1], TrustLevel[2] etc. This gives us much better flexibility naming trust levels, these names are meant to be controlled by various communities.
16 lines
324 B
Ruby
16 lines
324 B
Ruby
require_dependency 'enum_site_setting'
|
|
|
|
class TrustLevelSetting < EnumSiteSetting
|
|
|
|
def self.valid_value?(val)
|
|
valid_values.any? { |v| v.to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= valid_values.map {|x| {name: x.to_s, value: x} }
|
|
end
|
|
|
|
def self.valid_values
|
|
TrustLevel.valid_range.to_a
|
|
end
|
|
end
|