summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-05 15:59:31 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-05 15:59:31 +0200
commitc9853897229ca5585c69c4675cbeefd9ca53147d (patch)
tree3e0080a4636d751a141d8b01fc891054aca5a47c /app
parentfb12b81b422e0d17751f4b63462baa503996cd37 (diff)
downloadgitlab-ce-c9853897229ca5585c69c4675cbeefd9ca53147d.tar.gz
Add stage tests
Diffstat (limited to 'app')
-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)