diff options
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 89b9f8a7c..e2bc570e2 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -31,7 +31,7 @@ class Attachment < ActiveRecord::Base attr_protected :id acts_as_event :title => :filename, - :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id, :filename => o.filename}} + :url => Proc.new {|o| {:controller => 'attachments', :action => 'show', :id => o.id, :filename => o.filename}} acts_as_activity_provider :type => 'files', :permission => :view_files, @@ -251,6 +251,10 @@ class Attachment < ActiveRecord::Base Redmine::MimeType.of(filename) == "application/pdf" end + def previewable? + is_text? || is_image? + end + # Returns true if the file is readable def readable? disk_filename.present? && File.readable?(diskfile) |