Result
Module: Validations
Defined in:
addon/validations/result.js:24
This class is private
and is only used by ResultCollection
Methods
Methods
_handlePromise
()
private
Promise handler
update
(
private
-
result
Update the current validation result object with the given result
- If result is undefined or null, set isValid to false
- If result is a validations object from a different model/object, set the _validations object to the one given (belongs-to)
- If result is a collection of result objects, create a Validation Result Collection and set that to the _validations object (has-many)
- If result is a string, set the message to the given string and set isValid to false
- If result is a boolean, set isValid to result
- If result is a pojo, update _validations object with the information given
Parameters:
-
result
Object
Properties
_validations
Result
private
This hold all the logic for the above CPs. We do this so we can easily switch this object out with a different validations object
_validator
Validator
private
The validator that returned this result