forked from dhruvaray/backbone-associations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check existence, not value of identity
In relations with type Backbone.One, _setAttr was checking that data's id has a truthy value before comparing the identity with currVal's. This means that if id's value is falsy, such as 0, the predicate fails even if the actual values were the same. By checking for the id's existence instead, we match things up correctly even with falsy identities.
- Loading branch information
1 parent
f9aa28c
commit 210f188
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
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
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