Skip to content

Commit 158e7a9

Browse files
author
Vlad Balin
committed
collection validation put wrong id in error
1 parent 1cc4c04 commit 158e7a9

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"nestedtypes.js"
1919
],
2020
"license": "MIT",
21-
"version": "1.2.2"
21+
"version": "1.3.1"
2222
}

nestedtypes.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nestedtypes.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"LICENSE"
3636
],
3737
"license": "MIT",
38-
"version": "1.3.0",
38+
"version": "1.3.1",
3939
"scripts": {
4040
"test": "node_modules/.bin/mocha",
4141
"build": "./node_modules/.bin/webpack",

src/collection.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ module.exports = Backbone.Collection.extend( {
124124
length = 0;
125125

126126
for( var i = 0; i < models.length; i++ ){
127-
var error = models[ i ].validationError;
127+
var model = models[ i ],
128+
error = model.validationError;
129+
128130
if( error ){
129-
errors[ name ] = error;
131+
errors[ model.cid ] = error;
130132
length++;
131133
}
132134
}

0 commit comments

Comments
 (0)