From 1c9daacba799bea3b125acf39c44bcfda9038b4d Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Fri, 10 Nov 2023 11:26:28 -0800 Subject: [PATCH] :gift: pass parent and child model to PendingRelationship initialization --- app/models/iiif_print/pending_relationship.rb | 1 + lib/iiif_print/jobs/child_works_from_pdf_job.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/iiif_print/pending_relationship.rb b/app/models/iiif_print/pending_relationship.rb index f29b7e0c..dee6b60f 100644 --- a/app/models/iiif_print/pending_relationship.rb +++ b/app/models/iiif_print/pending_relationship.rb @@ -5,4 +5,5 @@ class PendingRelationship < ApplicationRecord validates :child_order, presence: true validates :parent_model, presence: true validates :child_model, presence: true + end end diff --git a/lib/iiif_print/jobs/child_works_from_pdf_job.rb b/lib/iiif_print/jobs/child_works_from_pdf_job.rb index 57574329..c82b52d1 100644 --- a/lib/iiif_print/jobs/child_works_from_pdf_job.rb +++ b/lib/iiif_print/jobs/child_works_from_pdf_job.rb @@ -96,7 +96,9 @@ def prepare_import_data(original_pdf_path, image_files, user) # save child work info to create the member relationships PendingRelationship.create!(child_title: child_title, parent_id: @parent_work.id, - child_order: child_title) + child_order: child_title, + parent_model: @parent_work.class, + child_model: @parent_work.iiif_print_config.pdf_split_child_model) begin # Clean up the temporary image path.