Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Last active March 11, 2016 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcardarella/9a92fa2c919569846bc5 to your computer and use it in GitHub Desktop.
Save bcardarella/9a92fa2c919569846bc5 to your computer and use it in GitHub Desktop.
import { presence, length, confirmation} from 'ember-validations/validators';
passwordValidations(context) {
return context
::presence('password', 'passwordConfirmation')
::length('password', { greaterThan: 8 })
::confirmation('password');
})
errors: computed('name', 'email', 'password', 'passwordConfirmation', function() {
let user = get(this, 'model');
return user
::presence('name', 'email')
::format('email', /@/)
::passwordValidations();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment