about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-01-13 13:14:35 +0100
committerThibaut Girka <thib@sitedethib.com>2020-01-13 13:14:35 +0100
commit83f8bf48d91605fa63325b4d4acec717031da025 (patch)
tree14bcdbeac5f8d904cad3d13a469869c5baf9db99 /app/models
parent7ab12b7654f04b2ea71cada9c8f0a41825864939 (diff)
parent3287ec8ca3bf8baad6cea0cc497753ff003d2d35 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/attachmentable.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/attachmentable.rb b/app/models/concerns/attachmentable.rb
index 1e8c4806f..43ff8ac12 100644
--- a/app/models/concerns/attachmentable.rb
+++ b/app/models/concerns/attachmentable.rb
@@ -74,7 +74,7 @@ module Attachmentable
     self.class.attachment_definitions.each_key do |attachment_name|
       attachment = send(attachment_name)
 
-      next if attachment.blank?
+      next if attachment.blank? || attachment.queued_for_write[:original].blank?
 
       attachment.instance_write :file_name, SecureRandom.hex(8) + File.extname(attachment.instance_read(:file_name))
     end