about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-13 12:54:33 +0100
committermultiple creatures <dev@multiple-creature.party>2020-02-21 04:11:05 -0600
commit6357b87c02feec94942bf5de57d896987d02d734 (patch)
treef37e1a92013d1f22a8fe28281ed22cd279ee6277 /app/models
parentec4ee47e07516b6bb15ff1bf52660dbd6f64a298 (diff)
Fix file names being obfuscated on update when file didn't change (#12857)
Fix #12849
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 9b3ca9e3c..641f2c4e3 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