Commit 3589e549 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch '14320-note-grouped_awards' into 'master'

Include user relationship when retrieving award_emoji

See merge request !4647
parents d8563bd6 52a2b8a4
......@@ -91,6 +91,7 @@ v 8.9.0 (unreleased)
- Horizontally scrolling navigation on project, group, and profile settings pages
- Hide global side navigation by default
- Remove tanuki logo from side navigation; center on top nav
- Include user relationships when retrieving award_emoji
v 8.8.5 (unreleased)
- Ensure branch cleanup regardless of whether the GitHub import process succeeds
......
......@@ -5,7 +5,7 @@ module Awardable
has_many :award_emoji, as: :awardable, dependent: :destroy
if self < Participable
participant :award_emoji
participant :award_emoji_with_associations
end
end
......@@ -34,8 +34,12 @@ module Awardable
end
end
def award_emoji_with_associations
award_emoji.includes(:user)
end
def grouped_awards(with_thumbs: true)
awards = award_emoji.group_by(&:name)
awards = award_emoji_with_associations.group_by(&:name)
if with_thumbs
awards[AwardEmoji::UPVOTE_NAME] ||= []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment