Skip to content

Commit

Permalink
🎁 pass parent and child model to PendingRelationship initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Shana Moore committed Nov 10, 2023
1 parent cff0d69 commit 1c9daac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/iiif_print/pending_relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ class PendingRelationship < ApplicationRecord
validates :child_order, presence: true
validates :parent_model, presence: true
validates :child_model, presence: true
end
end
4 changes: 3 additions & 1 deletion lib/iiif_print/jobs/child_works_from_pdf_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1c9daac

Please sign in to comment.