15 lines
463 B
CoffeeScript
15 lines
463 B
CoffeeScript
import {
|
|
validatePresence,
|
|
validateFormat
|
|
} from 'ember-changeset-validations/validators'
|
|
import buildMessage from 'ember-changeset-validations/utils/validation-errors'
|
|
|
|
validations =
|
|
nickname: validatePresence presence: true, message: (key, type) ->
|
|
buildMessage t("attributes.user.#{key}"), type: type
|
|
email: validateFormat type: 'email', message: (key, type) ->
|
|
buildMessage t("attributes.user.#{key}"), type: type
|
|
|
|
export default validations
|
|
|