summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-09-05 23:05:09 +0100
committerNick Thomas <nick@gitlab.com>2018-09-06 16:04:21 +0100
commiteea1b88547bb038b34b0691f0280d54d5dd23947 (patch)
tree3a148fdc021d97cd5b0fc565e755b579908201e9 /app/models/commit.rb
parent43859f59aec7d8dd0ce9998ea7ddfe365cd51391 (diff)
downloadgitlab-ce-eea1b88547bb038b34b0691f0280d54d5dd23947.tar.gz
Properly fix an introduced N+1 SQL issue loading commit authors
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index c993f3ed507..49c36ad9d3f 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -39,12 +39,7 @@ class Commit
def banzai_render_context(field)
pipeline = field == :description ? :commit_description : :single_line
context = { pipeline: pipeline, project: self.project }
-
- # The author is only needed when rendering the description
- if field == :description
- author = self.author
- context[:author] = author if author
- end
+ context[:author] = self.author if self.author
context
end