Merge pull request #1185 from y-yoshinoya/fix_broken_issue_attachments

fix upload problem for same file name by Redmine issue attachments
This commit is contained in:
Karel Picman 2020-10-30 08:03:15 +01:00 committed by GitHub
commit 515be5e95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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