Commit a6a0a98c authored by Mario de la Ossa's avatar Mario de la Ossa

Fix Iteration FOSS pipeline

parent a86470a3
......@@ -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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment