FIX: all basic integer settings should have max value validation

This commit is contained in:
Arpit Jalan
2017-04-20 13:19:50 +05:30
parent 94c7be3ca6
commit 9eff4f0807
3 changed files with 30 additions and 51 deletions

View File

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