diff options
Diffstat (limited to 'app/models/concerns/has_status.rb')
-rw-r--r-- | app/models/concerns/has_status.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index 2b559d8e828..a20e5bb6be6 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -2,12 +2,12 @@ module HasStatus extend ActiveSupport::Concern DEFAULT_STATUS = 'created'.freeze - BLOCKED_STATUS = 'blocked'.freeze - AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped blocked].freeze + BLOCKED_STATUS = 'manual'.freeze + AVAILABLE_STATUSES = %w[created pending running success failed canceled skipped manual].freeze STARTED_STATUSES = %w[running success failed skipped].freeze - ACTIVE_STATUSES = %w[pending running blocked].freeze + ACTIVE_STATUSES = %w[pending running manual].freeze COMPLETED_STATUSES = %w[success failed canceled skipped].freeze - ORDERED_STATUSES = %w[blocked failed pending running canceled success skipped].freeze + ORDERED_STATUSES = %w[manual failed pending running canceled success skipped].freeze class_methods do def status_sql @@ -16,7 +16,7 @@ module HasStatus builds = scope.select('count(*)').to_sql created = scope.created.select('count(*)').to_sql success = scope.success.select('count(*)').to_sql - blocked = scope.blocked.select('count(*)').to_sql + manual = scope.manual.select('count(*)').to_sql pending = scope.pending.select('count(*)').to_sql running = scope.running.select('count(*)').to_sql skipped = scope.skipped.select('count(*)').to_sql @@ -30,7 +30,7 @@ module HasStatus WHEN (#{builds})=(#{success})+(#{skipped})+(#{canceled}) THEN 'canceled' WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending' WHEN (#{running})+(#{pending})>0 THEN 'running' - WHEN (#{blocked})>0 THEN 'blocked' + WHEN (#{manual})>0 THEN 'manual' ELSE 'failed' END)" end @@ -63,7 +63,7 @@ module HasStatus state :success, value: 'success' state :canceled, value: 'canceled' state :skipped, value: 'skipped' - state :blocked, value: 'blocked' + state :manual, value: 'manual' end scope :created, -> { where(status: 'created') } @@ -74,13 +74,13 @@ module HasStatus scope :failed, -> { where(status: 'failed') } scope :canceled, -> { where(status: 'canceled') } scope :skipped, -> { where(status: 'skipped') } - scope :blocked, -> { where(status: 'blocked') } + scope :manual, -> { where(status: 'manual') } scope :running_or_pending, -> { where(status: [:running, :pending]) } scope :finished, -> { where(status: [:success, :failed, :canceled]) } scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) } scope :cancelable, -> do - where(status: [:running, :pending, :created, :blocked]) + where(status: [:running, :pending, :created, :manual]) end end |