diff options
Diffstat (limited to 'app/models/concerns/has_status.rb')
-rw-r--r-- | app/models/concerns/has_status.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index f5f5e64bcbe..ebfffe82510 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -8,7 +8,7 @@ module HasStatus ACTIVE_STATUSES = %w[pending running].freeze COMPLETED_STATUSES = %w[success failed canceled skipped].freeze ORDERED_STATUSES = %w[failed pending running manual canceled success skipped created].freeze - CANCELABLE_STATUSES = %w[running pending created manual].freeze + CANCELABLE_STATUSES = %w[running pending created].freeze class_methods do def status_sql @@ -69,7 +69,7 @@ module HasStatus end scope :created, -> { where(status: 'created') } - scope :relevant, -> { where.not(status: 'created') } + scope :relevant, -> { where(status: AVAILABLE_STATUSES - ['created']) } scope :running, -> { where(status: 'running') } scope :pending, -> { where(status: 'pending') } scope :success, -> { where(status: 'success') } @@ -77,6 +77,7 @@ module HasStatus scope :canceled, -> { where(status: 'canceled') } scope :skipped, -> { where(status: 'skipped') } scope :manual, -> { where(status: 'manual') } + scope :created_or_pending, -> { where(status: [:created, :pending]) } scope :running_or_pending, -> { where(status: [:running, :pending]) } scope :finished, -> { where(status: [:success, :failed, :canceled]) } scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) } |