Class: Kangaru::Validators::RequiredValidator
- Inherits:
-
Kangaru::Validator
- Object
- Kangaru::Validator
- Kangaru::Validators::RequiredValidator
- Defined in:
- lib/kangaru/validators/required_validator.rb
Constant Summary collapse
- MESSAGE =
"can't be blank".freeze
Instance Attribute Summary
Attributes inherited from Kangaru::Validator
#attribute, #model, #params, #value
Instance Method Summary collapse
Methods inherited from Kangaru::Validator
Constructor Details
This class inherits a constructor from Kangaru::Validator
Instance Method Details
#validate ⇒ Object
6 7 8 9 10 |
# File 'lib/kangaru/validators/required_validator.rb', line 6 def validate return unless value_missing? add_error!(MESSAGE) end |