Skip to content

Commit

Permalink
Merge pull request #6098 from avalonmediasystem/cjcolvar-patch-3
Browse files Browse the repository at this point in the history
Don't remove file_location since it is used to render the file's filename
  • Loading branch information
cjcolvar authored Nov 11, 2024
2 parents 178633c + 7603cc6 commit 7933ded
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions app/jobs/master_file_management_jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,8 @@ def perform(id)
when 'file' then File.delete(oldpath)
when 's3' then FileLocator::S3File.new(locator.source).object.delete
end
masterfile.file_location = ""
masterfile.save
Rails.logger.info "#{oldpath} has been deleted"
else
unless masterfile.file_location.empty?
masterfile.file_location = ""
masterfile.save
end
Rails.logger.warn "MasterFile #{oldpath} does not exist"
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/jobs/master_file_management_jobs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
it "should delete masterfile" do
MasterFileManagementJobs::Delete.perform_now(master_file.id)
expect(File.exist? location).to be false
expect(MasterFile.find(master_file.id).file_location).to be_blank
expect(MasterFile.find(master_file.id).file_location).not_to be_blank
end
end

Expand Down

0 comments on commit 7933ded

Please sign in to comment.