diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 00:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-18 00:09:39 +0300 |
commit | 63b9a1e5bd6f67dd375e00c44eedf6a526f6653d (patch) | |
tree | 224c640358c560f6b827a3a7efff6df2d774bb70 /app/models/iteration.rb | |
parent | 708ee0bcb2c20cc73db53c092a26f916139d15d4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/iteration.rb')
-rw-r--r-- | app/models/iteration.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/iteration.rb b/app/models/iteration.rb index c39743a021f..d223c80fca0 100644 --- a/app/models/iteration.rb +++ b/app/models/iteration.rb @@ -29,6 +29,7 @@ class Iteration < ApplicationRecord scope :upcoming, -> { with_state(:upcoming) } scope :started, -> { with_state(:started) } + scope :closed, -> { with_state(:closed) } scope :within_timeframe, -> (start_date, end_date) do where('start_date is not NULL or due_date is not NULL') @@ -63,9 +64,10 @@ class Iteration < ApplicationRecord case state when 'closed' then iterations.closed when 'started' then iterations.started + when 'upcoming' then iterations.upcoming when 'opened' then iterations.started.or(iterations.upcoming) when 'all' then iterations - else iterations.upcoming + else raise ArgumentError, "Unknown state filter: #{state}" end end |