Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a bug in the (crude) performance test

  • Loading branch information...
commit 1c8c2321782a40d2a1bfc937ea08f1fe60daf2b3 1 parent 891e4e8
@PaulUithol authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 test/tests.js
View
15 test/tests.js
@@ -4502,7 +4502,11 @@ $(document).ready(function() {
var Child = Backbone.RelationalModel.extend({
- url: '/child/'
+ url: '/child/',
+
+ toString: function() {
+ return this.id;
+ }
});
var Parent = Backbone.RelationalModel.extend({
@@ -4517,7 +4521,11 @@ $(document).ready(function() {
});
var Parents = Backbone.Collection.extend({
- model: Parent
+ model: Parent,
+
+ toString: function() {
+ return this.get( 'name' );
+ }
});
@@ -4595,7 +4603,8 @@ $(document).ready(function() {
start = new Date();
parents.each( function( parent ) {
- parent.get( 'children' ).each( function( child ) {
+ var children = _.clone( parent.get( 'children' ).models );
+ _.each( children, function( child ) {
child.destroy();
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.