summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 15:36:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 15:36:15 +0000
commit38e0c237a448c5d59caad9c6bab8461c7a118c09 (patch)
tree89d839c3866fa970ab997edc23e61f85cb6fcdde /app/models/attachment.rb
parentc4239a4fd2f9c91a43a170d19f3f913022428d0b (diff)
downloadredmine-38e0c237a448c5d59caad9c6bab8461c7a118c09.tar.gz
redmine-38e0c237a448c5d59caad9c6bab8461c7a118c09.zip
Image attachments are now sent inline to be viewed directly in the browser.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@642 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 108baf99a..443a75bab 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -84,6 +84,10 @@ class Attachment < ActiveRecord::Base
container.is_a?(Project) ? container : container.project
end
+ def image?
+ self.filename =~ /\.(jpeg|jpg|gif|png)$/i
+ end
+
private
def sanitize_filename(value)
# get only the filename, not the whole path