BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
52a2b8a4
Commit
52a2b8a4
authored
Jun 14, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include user relationship when retrieving award_emoji
Avoiding N+1 when showing grouped awards and when calculating participants for awardable entities
parent
bf4455d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
CHANGELOG
CHANGELOG
+1
-0
awardable.rb
app/models/concerns/awardable.rb
+6
-2
No files found.
CHANGELOG
View file @
52a2b8a4
...
...
@@ -90,6 +90,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
...
...
app/models/concerns/awardable.rb
View file @
52a2b8a4
...
...
@@ -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
]
||=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment