From da0fd995839662ee73f632744d6ba6ee3ea693b3 Mon Sep 17 00:00:00 2001 From: Julie Allinson Date: Fri, 29 Nov 2019 18:45:51 +0000 Subject: [PATCH] use uploaded_file for new versions --- app/controllers/hyrax/file_sets_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/hyrax/file_sets_controller.rb b/app/controllers/hyrax/file_sets_controller.rb index 085f502e8d..2806b5b91c 100644 --- a/app/controllers/hyrax/file_sets_controller.rb +++ b/app/controllers/hyrax/file_sets_controller.rb @@ -85,13 +85,18 @@ def attempt_update actor.revert_content(params[:revision]) elsif params.key?(:file_set) if params[:file_set].key?(:files) - actor.update_content(params[:file_set][:files].first) + actor.update_content(uploaded_file_from_path) else update_metadata end end end + def uploaded_file_from_path + uploaded_file = CarrierWave::SanitizedFile.new(params[:file_set][:files].first) + Hyrax::UploadedFile.create(user_id: current_user.id, file: uploaded_file) + end + def after_update_response respond_to do |wants| wants.html do