about summary refs log tree commit diff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-13 12:54:33 +0100
committerGitHub <noreply@github.com>2020-01-13 12:54:33 +0100
commit3287ec8ca3bf8baad6cea0cc497753ff003d2d35 (patch)
treef8f5303eac21fd31594b107eafa15ab45b5bc58a /app/models/concerns
parent3a6f9860fcbaaec488bd645a8150a514e4260efa (diff)
Fix file names being obfuscated on update when file didn't change (#12857)
Fix #12849
Diffstat (limited to 'app/models/concerns')
-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