Skip to content

Miscellaneous

validatesPresenceOf()

validatesPresenceOf() — returns any

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

NameTypeRequiredDefaultDescription
propertiesstringyes—See documentation for validatesConfirmationOf.
messagestringyes[property] can't be emptySee documentation for validatesConfirmationOf.
whenstringyesonSaveSee documentation for validatesConfirmationOf.
conditionstringyes—See documentation for validatesConfirmationOf.
unlessstringyes—See 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");