Skip inverse deletion if is a hasMany type. by nvahalik · Pull Request #376 · js-data/js-data
Navigation Menu
{{ message }}
- Notifications You must be signed in to change notification settings
- Fork 137
Closed
Skip inverse deletion if is a hasMany type.#376
nvahalik wants to merge 1 commit intojs-data:masterfrom
nvahalik:hasmany-unlinking-issue
Skip inverse deletion if is a hasMany type.#376
nvahalik wants to merge 1 commit intojs-data:masterfrom
nvahalik:hasmany-unlinking-issue
Conversation
Copy link Copy Markdown
Contributor
nvahalik
commented
Jul 28, 2016
nvahalik
commented
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.
Copy link Copy Markdown
Contributor
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.
Copy link Copy Markdown
Member
jmdobry
commented
Aug 3, 2016
jmdobry commented
Aug 3, 2016Thanks 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
closed this
jmdobry
modified the milestone:
3.0.0 Release Candidate
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment