summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-09 17:22:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-09 17:22:23 +0000
commit3e776af8066e478beb5d2bc9bd26e81d2bef2542 (patch)
tree4aa73b256f1a451e1fc2de06512ca1f1fd9badc8 /app/models/attachment.rb
parent3bdf6e995a35299c3e96cc7b0cbbd6a9baed0a98 (diff)
downloadredmine-3e776af8066e478beb5d2bc9bd26e81d2bef2542.tar.gz
redmine-3e776af8066e478beb5d2bc9bd26e81d2bef2542.zip
Don't force download of PDF (#22483).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@15409 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 7d577dc18..4bc674f8d 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -245,6 +245,10 @@ class Attachment < ActiveRecord::Base
self.filename =~ /\.(patch|diff)$/i
end
+ def is_pdf?
+ Redmine::MimeType.of(filename) == "application/pdf"
+ end
+
# Returns true if the file is readable
def readable?
File.readable?(diskfile)