diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 13:38:19 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 13:38:19 +0300 |
commit | 346a7c696abcf6d3d3a7e0281d951865c0e75c79 (patch) | |
tree | 3baf260318ef41b1ad78e7617ec4fab0a2a21b92 /app/models/commit_status.rb | |
parent | 3063ab45dd8a49a13ec5f8f091665600ed487bd3 (diff) |
Add after_stage scope to commit status class
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 9547c57b2ae..99a6326309d 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -23,9 +23,6 @@ class CommitStatus < ActiveRecord::Base where(id: max_id.group(:name, :commit_id)) end - scope :retried, -> { where.not(id: latest) } - scope :ordered, -> { order(:name) } - scope :failed_but_allowed, -> do where(allow_failure: true, status: [:failed, :canceled]) end @@ -36,8 +33,11 @@ class CommitStatus < ActiveRecord::Base false, all_state_names - [:failed, :canceled]) end + scope :retried, -> { where.not(id: latest) } + scope :ordered, -> { order(:name) } scope :latest_ordered, -> { latest.ordered.includes(project: :namespace) } scope :retried_ordered, -> { retried.ordered.includes(project: :namespace) } + scope :after_stage, -> (index) { where('stage_idx > ?', index) } state_machine :status do event :enqueue do |