Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e71df3cd
Commit
e71df3cd
authored
Aug 30, 2016
by
Andrew Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order award tooltips by their created_at date
parent
2db570e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
CHANGELOG
CHANGELOG
+1
-0
app/models/concerns/awardable.rb
app/models/concerns/awardable.rb
+1
-1
spec/models/concerns/awardable_spec.rb
spec/models/concerns/awardable_spec.rb
+10
-0
No files found.
CHANGELOG
View file @
e71df3cd
...
@@ -22,6 +22,7 @@ v 8.12.0 (unreleased)
...
@@ -22,6 +22,7 @@ v 8.12.0 (unreleased)
- Fix branch title trailing space on hover (ClemMakesApps)
- Fix branch title trailing space on hover (ClemMakesApps)
- Award emoji tooltips containing more than 10 usernames are now truncated !4780 (jlogandavison)
- Award emoji tooltips containing more than 10 usernames are now truncated !4780 (jlogandavison)
- Fix duplicate "me" in award emoji tooltip !5218 (jlogandavison)
- Fix duplicate "me" in award emoji tooltip !5218 (jlogandavison)
- Order award emoji tooltips in order they were added (EspadaV8)
- Fix spacing and vertical alignment on build status icon on commits page (ClemMakesApps)
- Fix spacing and vertical alignment on build status icon on commits page (ClemMakesApps)
- Update merge_requests.md with a simpler way to check out a merge request. !5944
- Update merge_requests.md with a simpler way to check out a merge request. !5944
- Fix button missing type (ClemMakesApps)
- Fix button missing type (ClemMakesApps)
...
...
app/models/concerns/awardable.rb
View file @
e71df3cd
...
@@ -2,7 +2,7 @@ module Awardable
...
@@ -2,7 +2,7 @@ module Awardable
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
included
do
included
do
has_many
:award_emoji
,
->
{
includes
(
:user
)
},
as: :awardable
,
dependent: :destroy
has_many
:award_emoji
,
->
{
includes
(
:user
)
.
order
(
:id
)
},
as: :awardable
,
dependent: :destroy
if
self
<
Participable
if
self
<
Participable
# By default we always load award_emoji user association
# By default we always load award_emoji user association
...
...
spec/models/concerns/awardable_spec.rb
View file @
e71df3cd
...
@@ -45,4 +45,14 @@ describe Issue, "Awardable" do
...
@@ -45,4 +45,14 @@ describe Issue, "Awardable" do
expect
{
issue
.
toggle_award_emoji
(
"thumbsdown"
,
award_emoji
.
user
)
}.
to
change
{
AwardEmoji
.
count
}.
by
(
-
1
)
expect
{
issue
.
toggle_award_emoji
(
"thumbsdown"
,
award_emoji
.
user
)
}.
to
change
{
AwardEmoji
.
count
}.
by
(
-
1
)
end
end
end
end
describe
'querying award_emoji on an Awardable'
do
let
(
:issue
)
{
create
(
:issue
)
}
it
'sorts in ascending fashion'
do
create_list
(
:award_emoji
,
3
,
awardable:
issue
)
expect
(
issue
.
award_emoji
).
to
eq
issue
.
award_emoji
.
sort_by
(
&
:id
)
end
end
end
end
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