Class: Grape::Validations::AtLeastOneOfValidator
- Inherits:
-
MultipleParamsBase
- Object
- Base
- MultipleParamsBase
- Grape::Validations::AtLeastOneOfValidator
- Defined in:
- lib/grape/validations/validators/at_least_one_of.rb
Instance Attribute Summary
Attributes inherited from MultipleParamsBase
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
convert_to_short_name, #fail_fast?, inherited, #initialize, #message, #options_key?, #validate
Constructor Details
This class inherits a constructor from Grape::Validations::Base
Instance Method Details
#validate!(params) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/grape/validations/validators/at_least_one_of.rb', line 5 def validate!(params) super if scope_requires_params && no_exclusive_params_are_present raise Grape::Exceptions::Validation, params: all_keys, message: (:at_least_one) end params end |