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
a6a0a98c
Commit
a6a0a98c
authored
May 26, 2020
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Iteration FOSS pipeline
parent
a86470a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
app/models/iteration.rb
app/models/iteration.rb
+10
-0
No files found.
app/models/iteration.rb
View file @
a6a0a98c
...
...
@@ -28,6 +28,12 @@ class Iteration < ApplicationRecord
scope
:upcoming
,
->
{
with_state
(
:upcoming
)
}
scope
:started
,
->
{
with_state
(
:started
)
}
scope
:within_timeframe
,
->
(
start_date
,
end_date
)
do
where
(
'start_date is not NULL or due_date is not NULL'
)
.
where
(
'start_date is NULL or start_date <= ?'
,
end_date
)
.
where
(
'due_date is NULL or due_date >= ?'
,
start_date
)
end
state_machine
:state_enum
,
initial: :upcoming
do
event
:start
do
transition
upcoming: :started
...
...
@@ -75,6 +81,10 @@ class Iteration < ApplicationRecord
self
.
state_enum
=
STATE_ENUM_MAP
[
value
]
end
def
resource_parent
group
||
project
end
private
def
start_or_due_dates_changed?
...
...
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