Skip to content

Commit

Permalink
remove not needed clean_content_type method
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Jun 15, 2023
1 parent fe61385 commit f765ec5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/jobs/deposit_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,12 @@ def build_file_metadata(blobs_map)
SdrClient::Deposit::Files::DirectUploadRequest.new(
checksum: blob.checksum,
byte_size: blob.byte_size,
content_type: clean_content_type(blob.content_type),
content_type: blob.content_type,
filename: blob.filename.to_s
)
end
end

def clean_content_type(content_type)
# ActiveStorage is expecting "application/x-stata-dta" not "application/x-stata-dta;version=14"
content_type&.split(';')&.first
end

def blob_filepath_for(blob)
ActiveStorage::Blob.service.path_for(blob.key)
end
Expand Down

0 comments on commit f765ec5

Please sign in to comment.