Defect #28440

After commit missing file

Added by Roman Shipiev over 2 years ago. Updated 2 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
Resolution:Duplicate Affected version:

Description

--- a/test/unit/attachment_transaction_test.rb
+++ b/test/unit/attachment_transaction_test.rb
@@ -73,4 +73,18 @@ class AttachmentTest < ActiveSupport::TestCase
     end
     assert File.exist?(diskfile)
   end
+
+  def test_after_commit_dont_missing_file
+    attachments =
+        ActiveRecord::Base.transaction do
+          (1..3).map do
+            Attachment.create!(
+                :file => 'anything',
+                :filename => 'filename.pdf',
+                :author => User.find(1)
+            )
+          end
+        end
+    assert attachments.reject { |a| File.exist?(a.diskfile) }.empty?
+  end
 end

Related issues

Duplicates Redmine - Defect #33769: When creating more than two identical attachments in a si... Closed

History

#1 Updated by Go MAEDA over 2 years ago

  • Category set to Attachments

#2 Updated by Go MAEDA 2 months ago

  • Duplicates Defect #33769: When creating more than two identical attachments in a single db transaction, the first one always ends up unreadable added

#3 Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

The issue will be fixed by #33769.

Also available in: Atom PDF