summaryrefslogtreecommitdiff
path: root/app/models/blob.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r--app/models/blob.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index 1c451a3976f..f82126f8e65 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -46,6 +46,10 @@ class Blob < SimpleDelegator
text? && language && language.name == 'SVG'
end
+ def pdf?
+ name && File.extname(name) == '.pdf'
+ end
+
def ipython_notebook?
text? && language&.name == 'Jupyter Notebook'
end
@@ -71,6 +75,8 @@ class Blob < SimpleDelegator
end
elsif image? || svg?
'image'
+ elsif pdf?
+ 'pdf'
elsif ipython_notebook?
'notebook'
elsif sketch?