app/jobs/bulkrax/create_relationships_job.rb in bulkrax-5.1.0 vs app/jobs/bulkrax/create_relationships_job.rb in bulkrax-5.2.0
- old
+ new
@@ -14,10 +14,12 @@
#
# NOTE: In the context of this job, "record" is used to generically refer
# to either an instance of a Work or an instance of a Collection.
# NOTE: In the context of this job, "identifier" is used to generically refer
# to either a record's ID or an Bulkrax::Entry's source_identifier.
+ # Please override with your own job for custom/non-hyrax applications
+ # set Bulkrax config variable :relationship_job to your custom class
class CreateRelationshipsJob < ApplicationJob
##
# @api public
# @since v5.0.1
#
@@ -110,9 +112,10 @@
child_record.file_sets.each(&:update_index) if update_child_records_works_file_sets? && child_record.respond_to?(:file_sets)
relationship.destroy
end
def add_to_collection(child_record, parent_record)
+ parent_record.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX)
child_record.member_of_collections << parent_record
child_record.save!
end
def add_to_work(child_record, parent_record)