This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
🎁 delete child works if the parent work is deleted #657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Story
TODO: This solution is too aggressive. This solution deletes anything in parent.ordered_works when the parent gets deleted, when really we want to delete any child works derived from the deleted PDF of a parent work.
In IiifPrint,
When a file set (PDF) gets deleted we will need to find the child works (pages) and any pending relationships related to it.
we should have a relationships or pending relationships (maybe sometimes both). delete the related
see #destroy_potential_children. Don't target all the PDFs. Only pending relationships for specific pdf.
See reload_single_pdf_job.rb (but this is too aggressive also and would only work for adventist).
Refs:
Expected Behavior Before Changes
Expected Behavior After Changes
Screenshots / Video
Notes