From: Go MAEDA Date: Wed, 1 Apr 2020 09:14:16 +0000 (+0000) Subject: Replace File#readable? with Attachment#readable? (#7056). X-Git-Tag: 4.2.0~1121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0a80c4c14b6a6cd339fa1bfcb5de4715619bef04;p=redmine.git Replace File#readable? with Attachment#readable? (#7056). git-svn-id: http://svn.redmine.org/redmine/trunk@19631 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/attachment.rb b/app/models/attachment.rb index a89a0c37e..b5a3332ac 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -347,7 +347,7 @@ class Attachment < ActiveRecord::Base end def self.archive_attachments(out_file, attachments) - attachments = attachments.select{|attachment| File.readable?(attachment.diskfile) } + attachments = attachments.select(&:readable?) return nil if attachments.blank? Zip.unicode_names = true