Minor fix

This commit is contained in:
Fabien Franzen 2014-07-27 16:56:30 +02:00
parent 1487a592c1
commit cd2cc68905
1 changed files with 2 additions and 1 deletions

View File

@ -1431,8 +1431,9 @@ RelationDefinition.embedsMany = function hasMany(modelFrom, modelTo, params) {
if (item instanceof modelTo) {
if (!item.isValid()) {
hasErrors = true;
var id = item[idName] || '(blank)';
var first = Object.keys(item.errors)[0];
var msg = 'contains invalid item: `' + item[idName] + '`';
var msg = 'contains invalid item: `' + id + '`';
msg += ' (' + first + ' ' + item.errors[first] + ')';
this.errors.add(relationName, msg, 'invalid');
}