diff options
author | Go MAEDA <maeda@farend.jp> | 2020-09-30 13:46:46 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-09-30 13:46:46 +0000 |
commit | 0d03bd5a255d1107966e6770d6407c1d33c63623 (patch) | |
tree | ca6f5731d56a5a584b6507879f48c51d092311cf /app/models | |
parent | 67c5d5bd2c310b616f22e962a13ad19c1461e61e (diff) | |
download | redmine-0d03bd5a255d1107966e6770d6407c1d33c63623.tar.gz redmine-0d03bd5a255d1107966e6770d6407c1d33c63623.zip |
Merged r20094 from trunk to 4.1-stable (#33769).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@20095 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/attachment.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 627c1a181..cf0ef5765 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -442,7 +442,8 @@ class Attachment < ActiveRecord::Base .where(digest: self.digest, filesize: self.filesize) .where('id <> ? and disk_filename <> ?', self.id, self.disk_filename) - .first + .order(:id) + .last existing.with_lock do original_diskfile = self.diskfile existing_diskfile = existing.diskfile |