Miscellaneous
validatesPresenceOf()
Signature
Section titled “Signature”validatesPresenceOf() — returns any
Description
Section titled “Description”Validates that the specified property exists and that its value is not blank.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
properties | string | yes | — | See documentation for validatesConfirmationOf. |
message | string | yes | [property] can't be empty | See documentation for validatesConfirmationOf. |
when | string | yes | onSave | See documentation for validatesConfirmationOf. |
condition | string | yes | — | See documentation for validatesConfirmationOf. |
unless | string | yes | — | See documentation for validatesConfirmationOf. |
Examples
Section titled “Examples”// Make sure that the user data can not be saved to the database without the `emailAddress` property. (It must exist and not be an empty string)
validatesPresenceOf("emailAddress");