Skip to content

Commit

Permalink
Adds ability to set filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Shana Moore committed Aug 6, 2024
1 parent 692499b commit dfb2503
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/factories/bulkrax/valkyrie_object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ def uploaded_s3_files(remote_files: {})
s3_bucket.files.get(key)
end.compact
else
# For local testing, create Hyrax::UploadedFile objects from URLs
remote_files.map do |r|
file_path = download_file(r["url"])
next unless file_path
Expand Down Expand Up @@ -404,7 +403,7 @@ def create_uploaded_file(file_path, file_name)
# TODO: add migration to Hyrax::UploadedFile so that it can accept filenames
# ref: https://github.com/samvera/hyrax/blob/main/app/models/hyrax/uploaded_file.rb
file = File.open(file_path)
uploaded_file = Hyrax::UploadedFile.create(file: file, user: @user)
uploaded_file = Hyrax::UploadedFile.create(file: file, user: @user, filename: file_name)
file.close
uploaded_file
rescue => e
Expand Down

0 comments on commit dfb2503

Please sign in to comment.