From: Eugen Rochko Date: Mon, 13 Jan 2020 11:54:33 +0000 (+0100) Subject: Fix file names being obfuscated on update when file didn't change (#12857) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=3287ec8ca3bf8baad6cea0cc497753ff003d2d35;p=mastodon.git Fix file names being obfuscated on update when file didn't change (#12857) Fix #12849 --- 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