add the 'more_then' validator to the params validator

pull/217/head
Alex Turchyn 2 years ago
parent d1070c4955
commit 00abad56cb

@ -110,5 +110,13 @@ module Params
raise_error(message || "#{key} must be one of #{values.join(', ')}") raise_error(message || "#{key} must be one of #{values.join(', ')}")
end 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
end end

Loading…
Cancel
Save