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
25d2f68c
Commit
25d2f68c
authored
Jul 02, 2021
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CURRENT_DATE instead of Date.current
parent
c83caa94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
app/models/milestone.rb
app/models/milestone.rb
+1
-1
No files found.
app/models/milestone.rb
View file @
25d2f68c
...
@@ -123,7 +123,7 @@ class Milestone < ApplicationRecord
...
@@ -123,7 +123,7 @@ class Milestone < ApplicationRecord
def
self
.
sort_with_expired_last
(
method
)
def
self
.
sort_with_expired_last
(
method
)
# NOTE: this is a custom ordering of milestones
# NOTE: this is a custom ordering of milestones
# to prioritize displaying non-expired milestones and milestones without due dates
# to prioritize displaying non-expired milestones and milestones without due dates
sorted
=
reorder
(
Arel
.
sql
(
"(CASE WHEN due_date IS NULL THEN 1 WHEN due_date >=
'
#{
Date
.
current
}
'
THEN 0 ELSE 2 END) ASC"
))
sorted
=
reorder
(
Arel
.
sql
(
"(CASE WHEN due_date IS NULL THEN 1 WHEN due_date >=
CURRENT_DATE
THEN 0 ELSE 2 END) ASC"
))
sorted
=
if
method
.
to_s
==
'expired_last_due_date_desc'
sorted
=
if
method
.
to_s
==
'expired_last_due_date_desc'
sorted
.
order
(
due_date: :desc
)
sorted
.
order
(
due_date: :desc
)
else
else
...
...
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