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
Jérome Perrin
gitlab-ce
Commits
0291473b
Commit
0291473b
authored
Mar 12, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes issues
parent
7530827e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+2
-2
app/models/milestone.rb
app/models/milestone.rb
+2
-3
No files found.
app/finders/issuable_finder.rb
View file @
0291473b
...
...
@@ -245,7 +245,7 @@ class IssuableFinder
end
def
upcoming?
params
[
:milestone_title
]
==
'#upcoming'
&&
projects
params
[
:milestone_title
]
==
'#upcoming'
end
def
by_milestone
(
items
)
...
...
@@ -253,7 +253,7 @@ class IssuableFinder
if
filter_by_no_milestone?
items
=
items
.
where
(
milestone_id:
[
-
1
,
nil
])
elsif
upcoming?
upcoming
=
Milestone
.
upcoming
(
projects
)
upcoming
=
Milestone
.
where
(
project_id:
projects
).
upcoming
items
=
items
.
joins
(
:milestone
).
where
(
milestones:
{
title:
upcoming
.
title
})
else
items
=
items
.
joins
(
:milestone
).
where
(
milestones:
{
title:
params
[
:milestone_title
]
})
...
...
app/models/milestone.rb
View file @
0291473b
...
...
@@ -82,9 +82,8 @@ class Milestone < ActiveRecord::Base
super
(
"milestones"
,
/(?<milestone>\d+)/
)
end
def
self
.
upcoming
(
projects
)
self
.
where
(
project_id:
projects
)
.
where
(
'due_date > ?'
,
Time
.
now
).
order
(
due_date: :asc
).
first
def
self
.
upcoming
self
.
where
(
'due_date > ?'
,
Time
.
now
).
order
(
due_date: :asc
).
first
end
def
to_reference
(
from_project
=
nil
)
...
...
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