8000 Skip inverse deletion if is a hasMany type. by nvahalik · Pull Request #376 · js-data/js-data · GitHub
[go: up one dir, main page]

Skip to content

Skip inverse deletion if is a hasMany type. #376

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

Closed
wants to merge 1 commit into from
Closed

Skip inverse deletion if is a hasMany type. #376

wants to merge 1 commit into from

Conversation

nvahalik
Copy link
Contributor

If the inverted relationship of a is a hasMany, it will unset it during the removal of a record that is within the set. See http://plnkr.co/edit/6KenzTlIliOTZuSxuBBp?p=preview for an example.

@zuzusik
Copy link
Contributor
zuzusik commented Jul 28, 2016

Skipping deletion only half-fixes the problem. In this case relations will have records that are already deleted. The proper solution would be to go through related items and to remove those that were deleted.

@pik pik mentioned this pull request Aug 2, 2016
@jmdobry jmdobry added the bug label Aug 3, 2016
@jmdobry jmdobry self-assigned this Aug 3, 2016
@jmdobry
Copy link
Member
jmdobry commented Aug 3, 2016

Thanks for opening this. I took a closer look at JSData's code, and found that the unlinking functionality had a bug. I've fixed it, and used the code in your plunker to create a test to verify the fix.

jmdobry added a commit that referenced this pull request Aug 3, 2016
@jmdobry jmdobry closed this Aug 3, 2016
@jmdobry jmdobry modified the milestone: 3.0.0 Release Candidate Aug 3, 2016
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
0