Created
March 9, 2015 22:26
-
-
Save jameshartig/67161afe7616ffa8632a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If a duplicate is found, prevent it from being added and | |
// optionally merge it into the existing model. | |
existing = this.get(attrs); | |
if (!existing) { | |
model = newModels[i] = this._prepareModel(attrs, options); | |
if (!model) continue; | |
existing = this.get(model); | |
} | |
if (existing) { | |
.... | |
} else if (add) { | |
toAdd.push(model); | |
this._addReference(model, options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment