diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-11-29 13:13:21 +0300 |
---|---|---|
committer | Tiago <tiagonbotelho@hotmail.com> | 2017-11-29 14:56:01 +0300 |
commit | d514e91c356923501cf69f942189ad04eedb5ebf (patch) | |
tree | 5ee3ed0356bc76c9d8c6e30cb9d13e43f0f085e0 /app | |
parent | d1945078a277d9b5474d88c467d3bf5e3d2a749a (diff) |
Merge branch 'events-atom-feed-author-query' into 'master'
Reuse authors when rendering event Atom feeds
See merge request gitlab-org/gitlab-ce!15630
(cherry picked from commit a2fea9288ef0a2d714827ac5b92e7330d3cb2c3f)
63180167 Reuse authors when rendering event Atom feeds
Diffstat (limited to 'app')
-rw-r--r-- | app/views/events/_event.atom.builder | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/views/events/_event.atom.builder b/app/views/events/_event.atom.builder index e2aec532a9d..38741fe6662 100644 --- a/app/views/events/_event.atom.builder +++ b/app/views/events/_event.atom.builder @@ -5,7 +5,12 @@ xml.entry do xml.link href: event_feed_url(event) xml.title truncate(event_feed_title(event), length: 80) xml.updated event.updated_at.xmlschema - xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(event.author_email)) + + # We're deliberately re-using "event.author" here since this data is + # eager-loaded. This allows us to re-use the user object's Email address, + # instead of having to run additional queries to figure out what Email to use + # for the avatar. + xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(event.author)) xml.author do xml.username event.author_username |