fix upload problem for same file name by Redmine issue attachments

This commit is contained in:
y-yoshinoya 2020-10-30 13:42:09 +09:00
parent b43f1465c8
commit 45846ea89d

View File

@ -70,7 +70,12 @@ class DmsfUploadController < ApplicationController
if defined?(EasyExtensions)
@attachment.skip_description_required = true
end
saved = @attachment.save
begin
Attachment.skip_callback(:commit, :after, :reuse_existing_file_if_possible)
saved = @attachment.save
ensure
Attachment.set_callback(:commit, :after, :reuse_existing_file_if_possible)
end
respond_to do |format|
format.js