Class: Toolchain::Validations::Validators::Acceptance
- Defined in:
- lib/toolchain/validations/validators/acceptance.rb
Overview
Validates the acceptance of an attribute. Accepted values are as follows: ‘true`, `1` and `“1”`.
Instance Attribute Summary
Attributes inherited from Base
#data, #errors, #key_path, #message, #object
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Toolchain::Validations::Validators::Base
Instance Method Details
#validate ⇒ Object
15 16 17 |
# File 'lib/toolchain/validations/validators/acceptance.rb', line 15 def validate errors.add(key_path, || "must be accepted") if not_accepted? end |