Skip to content

Commit

Permalink
Send string ids into job (#6975)
Browse files Browse the repository at this point in the history
* Send string ids into job

Serialize was failing on valkyrie ids

* Fix work factory to not automatically index
  • Loading branch information
laritakr authored Nov 15, 2024
1 parent a9c8e9c commit abd5955
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/freyja/persister.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def convert_and_migrate_resource(orm_object)
new_resource = resource_factory.to_resource(object: orm_object)
if Hyrax.config.valkyrie_transition?
MigrateFilesToValkyrieJob.perform_later(new_resource) if new_resource.is_a?(Hyrax::FileSet) && new_resource.file_ids.size == 1 && new_resource.file_ids.first.id.to_s.match('/files/')
MigrateResourcesJob.perform_later(ids: new_resource.member_ids) if new_resource.is_a?(Hyrax::Work)
MigrateResourcesJob.perform_later(ids: new_resource.member_ids.map(&:to_s)) if new_resource.is_a?(Hyrax::Work)
end
new_resource
end
Expand Down
9 changes: 8 additions & 1 deletion lib/hyrax/specs/shared_specs/factories/hyrax_work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@
Hyrax::EmbargoManager.new(resource: work).apply
Hyrax::LeaseManager.new(resource: work).apply

work.permission_manager.acl.save
if evaluator.with_index
work.permission_manager.acl.save
else
# manually save acl change_set so it does not automatically index the work
change_set = work.permission_manager.acl.send(:change_set)
change_set.sync
Hyrax.persister.save(resource: change_set.resource)
end

# This has to happen after permissions for permissions to propagate.
if evaluator.uploaded_files.present?
Expand Down

0 comments on commit abd5955

Please sign in to comment.