summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
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 45bbd5428..95de4837a 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_diff?
+ self.filename =~ /\.(patch|diff)$/i
+ end
+
private
def sanitize_filename(value)
# get only the filename, not the whole path