diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-09 18:40:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-09 18:40:59 +0000 |
commit | 80a7486f95a39ad3fc0946fad17fe51cff01cec6 (patch) | |
tree | 43e4ce8c5d338458359b5a8cf389972c93ac56f3 /app/models/attachment.rb | |
parent | aa0beecad0fa7cd8c62816b4dc7918f03b214b91 (diff) | |
download | redmine-80a7486f95a39ad3fc0946fad17fe51cff01cec6.tar.gz redmine-80a7486f95a39ad3fc0946fad17fe51cff01cec6.zip |
File viewer for attached text files.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1520 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 95de4837a..7d6a74ebb 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -88,6 +88,10 @@ class Attachment < ActiveRecord::Base self.filename =~ /\.(jpe?g|gif|png)$/i end + def is_text? + Redmine::MimeType.is_type?('text', filename) + end + def is_diff? self.filename =~ /\.(patch|diff)$/i end |