From: Toshi MARUYAMA Date: Thu, 17 Dec 2020 13:09:50 +0000 (+0000) Subject: place the '.' on the previous line of the method call at app/models/attachment.rb X-Git-Tag: 4.2.0~165 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0beee7746e0d89d8bbab83f963f6b15fd56a1fc1;p=redmine.git 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 --- 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