diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-09-30 08:59:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-09-30 08:59:54 +0000 |
commit | a8c1fc77ef58e4838a623569082cd08b80d95f85 (patch) | |
tree | 0c11a98125a7fd483f185eecbf563ef1ea44774e /app/models | |
parent | fb04274fc0102c046b533bc5d0cab523a9cbd2b5 (diff) | |
download | redmine-a8c1fc77ef58e4838a623569082cd08b80d95f85.tar.gz redmine-a8c1fc77ef58e4838a623569082cd08b80d95f85.zip |
code cleanup: rubocop: fix Layout/EmptyLinesAroundBlockBody in app/models/attachment.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18558 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/attachment.rb | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index a334024b4..29d1acc79 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -427,7 +427,6 @@ 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) @@ -435,14 +434,11 @@ class Attachment < ActiveRecord::Base self.id, self.disk_filename) .first existing.with_lock do - original_diskfile = self.diskfile existing_diskfile = existing.diskfile - if File.readable?(original_diskfile) && File.readable?(existing_diskfile) && FileUtils.identical?(original_diskfile, existing_diskfile) - self.update_columns disk_directory: existing.disk_directory, disk_filename: existing.disk_filename end @@ -459,7 +455,6 @@ class Attachment < ActiveRecord::Base # anymore, thats why this is caught and ignored as well. end - # Physically deletes the file from the file system def delete_from_disk! if disk_filename.present? && File.exist?(diskfile) |