mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
add the 'more_then' validator to the params validator
This commit is contained in:
1 parent
d1070c4955
commit
00abad56cb
1 file changed
+8
@@ -110,5 +110,13 @@ module Params
|
||||
|
||||
raise_error(message || "#{key} must be one of #{values.join(', ')}")
|
||||
end
|
||||
|
||||
def more_than(params, key, value, message: nil)
|
||||
return if params.blank?
|
||||
return if params[key].blank?
|
||||
return if params[key].to_f > value
|
||||
|
||||
raise_error(message || "#{key} must be more than #{value}")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user