Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-05 16:59:31 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-05 16:59:31 +0300
commitc9853897229ca5585c69c4675cbeefd9ca53147d (patch)
tree3e0080a4636d751a141d8b01fc891054aca5a47c /app/models
parentfb12b81b422e0d17751f4b63462baa503996cd37 (diff)
Add stage tests
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/commit.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index c77921979a6..46370034f9a 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -81,7 +81,8 @@ module Ci
end
def stage
- builds_without_retry.group(:stage_idx).select(:stage).last
+ running_or_pending = builds_without_retry.running_or_pending
+ running_or_pending.limit(1).pluck(:stage).first
end
def create_builds(ref, tag, user, trigger_request = nil)