summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-08-23 17:53:29 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-09-06 15:35:35 +0100
commit6d8e102c740b75ac9e1d168a84f532f6d9ebaa65 (patch)
tree803818e401c0f99a54c41776c5b8dec2c38fd9c0 /app/models/commit.rb
parentdd7434e398d26e5f4c92f73dce4bcf9b7e47e193 (diff)
downloadgitlab-ce-6d8e102c740b75ac9e1d168a84f532f6d9ebaa65.tar.gz
Adds cacheless render to Banzai object render34509-improves-markdown-rendering-performance-for-commits-list
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index ba3845df867..2ae8890c1b3 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -16,6 +16,8 @@ class Commit
participant :notes_with_associations
attr_accessor :project, :author
+ attr_accessor :redacted_description_html
+ attr_accessor :redacted_title_html
DIFF_SAFE_LINES = Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines]
@@ -26,6 +28,13 @@ class Commit
# The SHA can be between 7 and 40 hex characters.
COMMIT_SHA_PATTERN = '\h{7,40}'.freeze
+ def banzai_render_context(field)
+ context = { pipeline: :single_line, project: self.project }
+ context[:author] = self.author if self.author
+
+ context
+ end
+
class << self
def decorate(commits, project)
commits.map do |commit|