diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-08 20:15:16 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-08 20:15:16 +0300 |
commit | 6cbe38675dcd0547d9127373851471008e624e2b (patch) | |
tree | 82a89b246a2fa06a0eee9756929e06e059c17a7d /app/models/blob.rb | |
parent | 299a3a9aa0a91229f2767113145c3166ac642379 (diff) | |
parent | 369d681eec8177f03bf3b4f694e03098447dae09 (diff) |
Merge branch 'dm-blob-file-type' into 'master'
Add Blob#file_type convenience method
See merge request !11982
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r-- | app/models/blob.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb index 6f7cf35a767..3869e79ba75 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -155,6 +155,10 @@ class Blob < SimpleDelegator @extension ||= extname.downcase.delete('.') end + def file_type + Gitlab::FileDetector.type_of(path) + end + def video? UploaderHelper::VIDEO_EXT.include?(extension) end |