Unified diff viewer for attached files with .patch or .diff extension (#1403).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1516 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-06-08 18:26:39 +00:00
parent e833cab30e
commit d77c1d2829
7 changed files with 37 additions and 5 deletions
+4
View File
@@ -88,6 +88,10 @@ class Attachment < ActiveRecord::Base
self.filename =~ /\.(jpe?g|gif|png)$/i
end
def is_diff?
self.filename =~ /\.(patch|diff)$/i
end
private
def sanitize_filename(value)
# get only the filename, not the whole path