Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

issue #19735: Make sure statuses get cleaned up properly on collections.

  • Loading branch information...
commit 40db82dbee65d308afce078ea056115874241099 1 parent 1aae1cb
John Rogelstad jrogelstad authored
2  lib/backbone-x/source/collection.js
View
@@ -200,7 +200,7 @@ white:true*/
i,
K = XM.Model;
for (i = 0; i < result.models.length; i += 1) {
- result.models[i].setStatus(K.READY_CLEAN);
+ result.models[i].setStatus(K.READY_CLEAN, {cascade: true});
}
return result;
},
6 lib/backbone-x/source/model.js
View
@@ -24,9 +24,9 @@ white:true*/
// Instantiate a new model object
m = new XM.MyModel(null, {isNew: true});
</code></pre>
- To load an existing record include an id in the attributes:
+ To load an existing record use the `findOrCreate` method and include an id in the attributes:
<pre><code>
- m = new XM.MyModel({id: 1});
+ m = XM.MyModel.findOrCreate({id: 1});
m.fetch();
</code></pre>
@@ -1070,6 +1070,8 @@ white:true*/
model.setStatus(status, options);
}
});
+ } else if (attr && relation.type === Backbone.HasOne) {
+ attr.setStatus(status, options);
}
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.