summaryrefslogtreecommitdiff
path: root/app/models/blob.rb
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-09-06 17:48:57 +0800
committerMark Chao <mchao@gitlab.com>2018-10-30 15:44:55 +0800
commit32f9cf8ce3dd337bf3b1683c5872171c253f0d27 (patch)
treeda6f8077d458283ae1da56cbc9e282c87cdeba0a /app/models/blob.rb
parent6580de78bb52323fcafaaf4d2e770590e4f1c586 (diff)
downloadgitlab-ce-32f9cf8ce3dd337bf3b1683c5872171c253f0d27.tar.gz
Add BlobPresenter for highlighting
Force FoundBlob to use BlobPresenter
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r--app/models/blob.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index e5854415dd2..425ba69c073 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -1,7 +1,9 @@
# frozen_string_literal: true
-# Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects
+# Blob is a Rails-specific wrapper around Gitlab::Git::Blob, SnippetBlob and Ci::ArtifactBlob
class Blob < SimpleDelegator
+ include Presentable
+
CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute
CACHE_TIME_IMMUTABLE = 3600 # Cache blobs referred to by an immutable reference for 1 hour