]> source.dussan.org Git - redmine.git/commitdiff
Reverts r20654.
authorGo MAEDA <maeda@farend.jp>
Wed, 17 Mar 2021 13:32:44 +0000 (13:32 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 17 Mar 2021 13:32:44 +0000 (13:32 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20811 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/attachment.rb

index 2ecabb4fdf4b3956380fa5a744f65b27979c883c..7bce5ded6c49c8a1c97c41dbaa35d1adaf4892fb 100644 (file)
@@ -498,12 +498,12 @@ class Attachment < ActiveRecord::Base
   def reuse_existing_file_if_possible
     original_diskfile = nil
     reused = with_lock do
-      if existing = Attachment.
-                      where(digest: self.digest, filesize: self.filesize).
-                      where('id <> ? and disk_filename <> ?',
-                            self.id, self.disk_filename).
-                      order(:id).
-                      last
+      if existing = Attachment
+                      .where(digest: self.digest, filesize: self.filesize)
+                      .where('id <> ? and disk_filename <> ?',
+                             self.id, self.disk_filename)
+                      .order(:id)
+                      .last
         existing.with_lock do
           original_diskfile = self.diskfile
           existing_diskfile = existing.diskfile