app/controllers/concerns/hyrax/embargoes_controller_behavior.rb in hyrax-5.0.0.rc1 vs app/controllers/concerns/hyrax/embargoes_controller_behavior.rb in hyrax-5.0.0.rc2
- old
+ new
@@ -29,10 +29,16 @@
# rubocop:disable Metrics/PerceivedComplexity
def update
filter_docs_with_edit_access!
copy_visibility = []
copy_visibility = params[:embargoes].values.map { |h| h[:copy_visibility] } if params[:embargoes]
- resources = Hyrax.custom_queries.find_many_by_alternate_ids(alternate_ids: batch, use_valkyrie: Hyrax.config.use_valkyrie?)
+
+ resources = if Hyrax.config.use_valkyrie?
+ Hyrax.query_service.find_many_by_ids(ids: batch)
+ else
+ Hyrax.custom_queries.find_many_by_alternate_ids(alternate_ids: batch, use_valkyrie: false)
+ end
+
resources.each do |resource|
if Hyrax.config.use_valkyrie?
EmbargoManager.new(resource: resource).release!
Hyrax::AccessControlList(resource).save
Hyrax::VisibilityPropagator.for(source: resource).propagate if copy_visibility.include?(resource.id)