mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Change default email_in minimum trust to 2
Also, rename MinTrustToCreateTopicSetting to TrustLevelSetting, and apply it to more settings
This commit is contained in:
18
app/models/trust_level_setting.rb
Normal file
18
app/models/trust_level_setting.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
def self.valid_values
|
||||
TrustLevel.levels.values.sort
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user