From cd2cc68905f9431790543f604281dc9c47cd6330 Mon Sep 17 00:00:00 2001 From: Fabien Franzen Date: Sun, 27 Jul 2014 16:56:30 +0200 Subject: [PATCH] Minor fix --- lib/relation-definition.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 3d795bcf..001075a9 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -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'); }