From ad337a781873e3775190e990b9cea0177147f958 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 23 Jun 2015 16:46:36 +0300 Subject: Ability to cancel all builds in the commit at once --- app/models/build.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/build.rb') diff --git a/app/models/build.rb b/app/models/build.rb index 2ffb80c..6124c8f 100644 --- a/app/models/build.rb +++ b/app/models/build.rb @@ -32,6 +32,7 @@ class Build < ActiveRecord::Base scope :success, ->() { where(status: "success") } scope :failed, ->() { where(status: "failed") } scope :unstarted, ->() { where(runner_id: nil) } + scope :running_or_pending, ->() { where(status:[:running, :pending]) } acts_as_taggable -- cgit v1.2.1