From 0beee7746e0d89d8bbab83f963f6b15fd56a1fc1 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 17 Dec 2020 13:09:50 +0000 Subject: [PATCH] place the '.' on the previous line of the method call at app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20654 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/attachment.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 924bae4f7..3d8d0ee1e 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 -- 2.39.5