Skip to content

Miscellaneous

validatesPresenceOf()

validatesPresenceOf() — returns any

Validates that the specified property exists and that its value is not blank.

NameTypeRequiredDefaultDescription
propertiesstringyesSee documentation for validatesConfirmationOf.
messagestringyes[property] can't be emptySee documentation for validatesConfirmationOf.
whenstringyesonSaveSee documentation for validatesConfirmationOf.
conditionstringyesSee documentation for validatesConfirmationOf.
unlessstringyesSee documentation for validatesConfirmationOf.
// 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");