Sha256: 0ad4c95ec411e8959418c4f5090f08d2d8e511e45828703ca37a47c84432e17d

Contents?: true

Size: 375 Bytes

Versions: 10

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

module Grape
  module Validations
    module Validators
      class AtLeastOneOfValidator < MultipleParamsBase
        def validate_params!(params)
          return unless keys_in_common(params).empty?

          raise Grape::Exceptions::Validation.new(params: all_keys, message: message(:at_least_one))
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
grape-2.2.0 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-2.1.3 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-2.1.2 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-2.1.1 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-2.1.0 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-2.0.0 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-1.8.0 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-1.7.1 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-1.7.0 lib/grape/validations/validators/at_least_one_of_validator.rb
grape-1.6.1 lib/grape/validations/validators/at_least_one_of_validator.rb