diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-08-23 19:53:29 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-09-06 17:35:35 +0300 |
commit | 6d8e102c740b75ac9e1d168a84f532f6d9ebaa65 (patch) | |
tree | 803818e401c0f99a54c41776c5b8dec2c38fd9c0 /app/models | |
parent | dd7434e398d26e5f4c92f73dce4bcf9b7e47e193 (diff) |
Adds cacheless render to Banzai object render
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/commit.rb | 9 |
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| |