Method: Hyrax::BatchEditsController#valkyrie_update_document

Defined in:
app/controllers/hyrax/batch_edits_controller.rb

#valkyrie_update_document(obj) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'app/controllers/hyrax/batch_edits_controller.rb', line 63

def valkyrie_update_document(obj)
  form = form_class.new(obj, current_ability, nil)
  return unless form.validate(params[form_class.model_class.model_name.param_key])

  cleanup_form_fields form

  result = transactions['change_set.update_work']
           .with_step_args('work_resource.save_acl' => { permissions_params: form.input_params["permissions"] })
           .call(form)
  obj = result.value!

  InheritPermissionsJob.perform_now(obj)
  VisibilityCopyJob.perform_now(obj)
end