Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check existence, not value of identity for 1-1 relations #112

Merged
merged 1 commit into from
Feb 25, 2014

Conversation

arirahikkala
Copy link
Contributor

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.

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.
@dhruvaray dhruvaray added bug and removed bug labels Feb 25, 2014
@dhruvaray dhruvaray self-assigned this Feb 25, 2014
@dhruvaray dhruvaray added the bug label Feb 25, 2014
dhruvaray added a commit that referenced this pull request Feb 25, 2014
Check existence, not value of identity for 1-1 relations
@dhruvaray dhruvaray merged commit 04ba935 into dhruvaray:master Feb 25, 2014
@dhruvaray
Copy link
Owner

Thanks for the PR and the test case... Much appreciated!

@jdkanani
Copy link
Contributor

@arirahikkala Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants