diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2017-03-19 00:35:17 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-20 09:40:36 +0100 |
commit | 45f1975d7e3ae0f26e59d5e7e08c261575147ec5 (patch) | |
tree | c33da4eaea652d0b45c2715f71b220e4c197df25 /app/models | |
parent | c191c1103b37903f2293c2a662cdc616228b9eb7 (diff) | |
download | gitlab-ce-45f1975d7e3ae0f26e59d5e7e08c261575147ec5.tar.gz |
Simplify Ci::Build#dependencies method
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 90a195dc048..ad0be70c32a 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -542,16 +542,11 @@ module Ci def dependencies depended_jobs = depends_on_builds - return depended_jobs unless options[:dependencies] && !options[:dependencies].empty? + return depended_jobs unless options[:dependencies].present? - selected = [] - depended_jobs.each do |job| - options[:dependencies].each do |job_name| - selected << job if job.name == job_name - end + depended_jobs.select do |job| + options[:dependencies].include?(job.name) end - - selected end private |