Skip inverse deletion if is a hasMany type. by nvahalik · Pull Request #376 · js-data/js-data

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Closed

nvahalik wants to merge 1 commit intojs-data:masterfrom

nvahalik:hasmany-unlinking-issue

Closed

Skip inverse deletion if is a hasMany type.#376

nvahalik wants to merge 1 commit intojs-data:masterfrom

nvahalik:hasmany-unlinking-issue

Conversation

@nvahalik

Copy link Copy Markdown

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 Copy Markdown

Contributor

zuzusik commented

Jul 28, 2016

edited

Loading

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.

nickescallon reacted with thumbs up emoji

@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 Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

@jmdobry jmdobry

Labels

Projects

None yet

Milestone

3.0.0 Release Candidate

Development

Successfully merging this pull request may close these issues.

3 participants

@nvahalik @zuzusik @jmdobry