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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
26c06b42
Commit
26c06b42
authored
Jul 29, 2021
by
Andrew Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When ordering epics by title, do so case-insensitively
Changelog: fixed EE: true
parent
21607dbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
ee/app/models/ee/epic.rb
ee/app/models/ee/epic.rb
+2
-7
ee/spec/models/epic_spec.rb
ee/spec/models/epic_spec.rb
+3
-2
No files found.
ee/app/models/ee/epic.rb
View file @
26c06b42
...
...
@@ -112,13 +112,8 @@ module EE
reorder
(
keyset_order
)
end
scope
:order_title_asc
,
->
do
reorder
(
title: :asc
)
end
scope
:order_title_desc
,
->
do
reorder
(
title: :desc
)
end
scope
:order_title_asc
,
->
{
reorder
(
Arel
::
Nodes
::
Ascending
.
new
(
arel_table
[
:title
].
lower
))
}
scope
:order_title_desc
,
->
{
reorder
(
Arel
::
Nodes
::
Descending
.
new
(
arel_table
[
:title
].
lower
))
}
scope
:order_closed_date_desc
,
->
{
reorder
(
closed_at: :desc
)
}
...
...
ee/spec/models/epic_spec.rb
View file @
26c06b42
...
...
@@ -91,15 +91,16 @@ RSpec.describe Epic do
let_it_be
(
:epic1
)
{
create
(
:epic
,
title:
'foo'
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
,
title:
'bar'
)
}
let_it_be
(
:epic3
)
{
create
(
:epic
,
title:
'baz'
)
}
let_it_be
(
:epic4
)
{
create
(
:epic
,
title:
'Baz 2'
)
}
describe
'.order_title_asc'
do
it
'returns epics ordered by title, ascending'
do
expect
(
described_class
.
order_title_asc
).
to
eq
([
epic2
,
epic3
,
epic1
,
confidential_epic
,
public_epic
])
expect
(
described_class
.
order_title_asc
).
to
eq
([
epic2
,
epic3
,
epic
4
,
epic
1
,
confidential_epic
,
public_epic
])
end
describe
'.order_title_desc'
do
it
'returns epics ordered by title, decending'
do
expect
(
described_class
.
order_title_desc
).
to
eq
([
public_epic
,
confidential_epic
,
epic1
,
epic3
,
epic2
])
expect
(
described_class
.
order_title_desc
).
to
eq
([
public_epic
,
confidential_epic
,
epic1
,
epic
4
,
epic
3
,
epic2
])
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