]> source.dussan.org Git - redmine.git/commitdiff
Replace File#readable? with Attachment#readable? (#7056).
authorGo MAEDA <maeda@farend.jp>
Thu, 2 Apr 2020 05:52:39 +0000 (05:52 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 2 Apr 2020 05:52:39 +0000 (05:52 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19635 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/attachments_controller.rb

index a41476f8010d110665788be5fcb4b019183c114e..b69dcf9838982cff999fb7f1350993aa53b82c9d 100644 (file)
@@ -237,7 +237,7 @@ class AttachmentsController < ApplicationController
   end
 
   def find_downloadable_attachments
-    @attachments = @container.attachments.select{|a| File.readable?(a.diskfile) }
+    @attachments = @container.attachments.select(&:readable?)
     bulk_download_max_size = Setting.bulk_download_max_size.to_i.kilobytes
     if @attachments.sum(&:filesize) > bulk_download_max_size
       flash[:error] = l(:error_bulk_download_size_too_big,