Skip to content

Instantly share code, notes, and snippets.

@danmactough
Created September 9, 2011 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmactough/1206674 to your computer and use it in GitHub Desktop.
Save danmactough/1206674 to your computer and use it in GitHub Desktop.
Model.post('init', function() {
if (!this.isNew) {
var my = this
, activePaths = Object.keys(this._activePaths.states.init);
Object.keys(my._doc).forEach(function(path){
if (activePaths.indexOf(path) === -1) {
delete(my._doc[path]);
}
});
this._doc = my._doc;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment