Module: VanillaValidator::ValidationExtensions
- Defined in:
- lib/vanilla_validator/railtie.rb
Overview
The ValidationExtensions module provides methods for validating ActionController::Parameters against a specified contract.
Instance Method Summary collapse
-
#validate(contract) ⇒ Object
Validates the ActionController::Parameters against the specified contract.
-
#validate!(contract) ⇒ Object
Validates the ActionController::Parameters against the specified contract and raises an exception if the validation fails.
Instance Method Details
#validate(contract) ⇒ Object
Validates the ActionController::Parameters against the specified contract.
27 28 29 |
# File 'lib/vanilla_validator/railtie.rb', line 27 def validate(contract) VanillaValidator.validate(self.to_unsafe_h, contract) end |
#validate!(contract) ⇒ Object
Validates the ActionController::Parameters against the specified contract and raises an exception if the validation fails.
35 36 37 |
# File 'lib/vanilla_validator/railtie.rb', line 35 def validate!(contract) VanillaValidator.validate!(self.to_unsafe_h, contract) end |