Show:

_contentResults

Array private

_contentValidators

Array private

attribute

String

The attribute that this collection belongs to

error

Error

An alias to the first Error in the errors collection.

// Example
  get(user, 'validations.error')
  get(user, 'validations.attrs.username.error')
  

errors

Array

A collection of all Errors on the object in question. Each error object includes the error message and it's associated attribute name.

// Example
  get(user, 'validations.errors')
  get(user, 'validations.attrs.username.errors')
  

hasWarnings

String

Will be true if there are warnings in the collection.

// Example
  get(user, 'validations.hasWarnings')
  get(user, 'validations.attrs.username.hasWarnings')
  

isAsync

Boolean

Will be true only if a validation returns a promise

// Examples
  get(user, 'validations.isAsync')
  get(user, 'validations.attrs.username.isAsync')
  


Default: false

isInvalid

Boolean
// Examples
  get(user, 'validations.isInvalid')
  get(user, 'validations.attrs.username.isInvalid')
  


Default: false

isTruelyInvalid

Boolean

Will be true only if isValid is false and isValidating is false

// Examples
  get(user, 'validations.isTruelyInvalid')
  get(user, 'validations.attrs.username.isTruelyInvalid')
  


Default: false

isTruelyValid

Boolean

Will be true only if isValid is true and isValidating is false

// Examples
  get(user, 'validations.isTruelyValid')
  get(user, 'validations.attrs.username.isTruelyValid')
  


Default: true

isValid

Boolean
// Examples
  get(user, 'validations.isValid')
  get(user, 'validations.attrs.username.isValid')
  


Default: true

isValidating

Boolean

This property is toggled only if there is an async validation

// Examples
  get(user, 'validations.isValidating')
  get(user, 'validations.attrs.username.isValidating')
  


Default: false

message

String

An alias to the first message in the messages collection.

// Example
  get(user, 'validations.message')
  get(user, 'validations.attrs.username.message')
  

messages

Array

A collection of all error messages on the object in question

// Examples
  get(user, 'validations.messages')
  get(user, 'validations.attrs.username.messages')
  

options

Object

All built options of the validators associated with the results in this collection grouped by validator type

// Given the following validators
  {
    username: [
      validator('presence', true),
      validator('length', { max: 15 }),
      validator('format', { regex: /foo/ }),
      validator('format', { regex: /bar/ }),
    ]
  }
  
get(user, 'validations.attrs.username.options')
  

The above will return the following

{
    'presence': { presence: true},
    'length': { max: 15 },
    'regex': [{ regex: /foo/ }, { regex: /bar/ }]
  }
  

warning

Error

An alias to the first Warning in the warnings collection.

// Example
  get(user, 'validations.warning')
  get(user, 'validations.attrs.username.warning')
  

warningMessage

String

An alias to the first message in the warningMessages collection.

// Example
  get(user, 'validations.warningMessage')
  get(user, 'validations.attrs.username.warningMessage')
  

warningMessages

Array

A collection of all warning messages on the object in question

// Examples
  get(user, 'validations.warningMessages')
  get(user, 'validations.attrs.username.warningMessages')
  

warnings

Array

A collection of all Warnings on the object in question. Each warning object includes the warning message and it's associated attribute name.

// Example
  get(user, 'validations.warnings')
  get(user, 'validations.attrs.username.warnings')