Sha256: 749bc47746707c37d5b4861b878791aaa2a3f8ce228f511cbd5f3f9d5ec2bf9d
Contents?: true
Size: 430 Bytes
Versions: 4
Compression:
Stored size: 430 Bytes
Contents
module Grape module Kaminari class MaxValueValidator < Grape::Validations::SingleOptionValidator def validate_param!(attr_name, params) return unless params[attr_name] attr = params[attr_name] if attr && @option && attr > @option raise Grape::Exceptions::Validation, param: @scope.full_name(attr_name), message: "must be less than #{@option}" end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems