diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-12 11:15:19 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-04-12 11:15:19 +0200 |
commit | 1ae797c22900a6e32d63883f6a2d76c498e20d9b (patch) | |
tree | 3d60a1eada0ebd15d4f5c74cbdecd979ca44801e /app | |
parent | ac50f9dddfb4555a2c356454c1cbfc1cc0b37d6d (diff) | |
download | gitlab-ce-1ae797c22900a6e32d63883f6a2d76c498e20d9b.tar.gz |
Fix create_next_builds method
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/commit.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 2ab1fefe8e1..94951ced1fd 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -116,12 +116,12 @@ module Ci next_stages.delete(build.stage) # get status for all prior builds - prior_builds = latest_builds.reject { |other_build| next_stages.include?(other_build.stage) } - status = prior_builds.status + prior_builds = latest_builds.where.not(stage: next_stages) + prior_status = prior_builds.status # create builds for next stages based next_stages.any? do |stage| - CreateBuildsService.new(self).execute(stage, build.user, status, build.trigger_request).present? + CreateBuildsService.new(self).execute(stage, build.user, prior_status, build.trigger_request).present? end end |