Skip to content

Commit

Permalink
Just update to the current id
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed May 24, 2015
1 parent f430fa0 commit ea82dad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,6 @@
}
current = this.attributes, prev = this._previousAttributes;

// Check for changes of `id`.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];

// For each `set` attribute, update or delete the current value.
for (attr in attrs) {
val = attrs[attr];
Expand All @@ -488,6 +485,9 @@
unset ? delete current[attr] : current[attr] = val;
}

// Update id
this.id = current[this.idAttribute];

// Trigger all relevant attribute changes.
if (!silent) {
if (changes.length) this._pending = options;
Expand Down

0 comments on commit ea82dad

Please sign in to comment.