Skip to content

Commit

Permalink
Adding notes about transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Feb 2, 2024
1 parent 60aff98 commit f889c31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/jobs/bulkrax/create_relationships_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ def add_to_valkyrie_work(child_record, parent_record)
return true if parent_record.member_ids.include?(child_record.id)

parent_record.member_ids << child_record.id

# TODO: Hyrax is in the process of extracting an "Action" object that we could call. It does
# provide validation that we may want to consider.
#
# NOTE: We may need to look at the step args we're passing, see
# `Hyrax::WorksControllerBehavior#update_valkyrie_work`
# Hyrax's `./app/controllers/concerns/hyrax/works_controller_behavior.rb`
#
change_set = Hyrax::ChangeSet.for(parent_record)
Hyrax::Transactions::Container['change_set.update_work'].call(change_set)
end
Expand Down

0 comments on commit f889c31

Please sign in to comment.