Project

General

Profile

Actions

Defect #28440

closed

After commit missing file

Added by Roman Shipiev about 6 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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

Is duplicate of Redmine - Defect #33769: When creating more than two identical attachments in a single db transaction, the first one always ends up unreadableClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA almost 6 years ago

  • Category set to Attachments
Actions #2

Updated by Go MAEDA over 3 years ago

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

Updated by Go MAEDA over 3 years ago

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

The issue will be fixed by #33769.

Actions

Also available in: Atom PDF