mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
FIX: all basic integer settings should have max value validation
This commit is contained in:
parent
94c7be3ca6
commit
9eff4f0807
3 changed files with 30 additions and 51 deletions
|
@ -1,6 +1,8 @@
|
|||
class IntegerSettingValidator
|
||||
def initialize(opts={})
|
||||
@opts = opts
|
||||
@opts[:min] = 0 unless @opts[:min].present?
|
||||
@opts[:max] = 20000 unless @opts[:max].present?
|
||||
end
|
||||
|
||||
def valid_value?(val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue