gitlab-org--gitlab-foss/app/workers/delete_diff_files_worker.rb
gfyoung d4da4829d4 Enable frozen string in newly added files
Enables frozen string for new files in
directories that had been previously
covered in previous MR's.

Partially addresses #47424.
2018-07-21 19:00:50 -07:00

19 lines
440 B
Ruby

# frozen_string_literal: true
class DeleteDiffFilesWorker
include ApplicationWorker
def perform(merge_request_diff_id)
merge_request_diff = MergeRequestDiff.find(merge_request_diff_id)
return if merge_request_diff.without_files?
MergeRequestDiff.transaction do
merge_request_diff.clean!
MergeRequestDiffFile
.where(merge_request_diff_id: merge_request_diff.id)
.delete_all
end
end
end