FIX: do not impose default min/max validation on hidden site setting

This commit is contained in:
Arpit Jalan
2017-04-22 12:06:02 +05:30
parent 5fab2042f5
commit dad2024094
2 changed files with 11 additions and 2 deletions

View File

@ -1,8 +1,8 @@
class IntegerSettingValidator
def initialize(opts={})
@opts = opts
@opts[:min] = 0 unless @opts[:min].present?
@opts[:max] = 20000 unless @opts[:max].present?
@opts[:min] = 0 unless @opts[:min].present? || @opts[:hidden]
@opts[:max] = 20000 unless @opts[:max].present? || @opts[:hidden]
end
def valid_value?(val)