Skip to content

presence

Myles Megyesi edited this page May 8, 2013 · 4 revisions

Usage

(defvalidator user-validator
  [:name :presence])

(user-validator {:name nil})
; {:name ["is not present"]}

(user-validator {:name ""})
; {:name ["is not present"]}

(user-validator {:name "Jimmy John's"})
; {}

An object will be considered present unless it is nil, an empty string, or an empty collection.

Options:

None.

Default error message:

"must be present"

Clone this wiki locally