gitlab-org--gitlab-foss/app/models/ci
Yorick Peterse 54f1e406f4
Use arrays in Pipeline#latest_builds_with_artifacts
This changes Ci::Pipeline#latest_builds_with_artifacts so it returns an
Array instead of a relation. Whenever we use this data we do so in two
steps:

1. Count the number of rows
2. If this number is greater than 0, iterate over the rows

By returning an Array instead we only execute 1 query of which the total
time/work is less than running either just a COUNT(*) or both queries
(in the worst case).

On GitLab.com this change should save us a few milliseconds per request
to ProjectsController#show.
2017-11-21 17:40:29 +01:00
..
artifact_blob.rb Fix the external URLs generated for online view of HTML artifacts 2017-10-20 23:38:35 +01:00
build.rb Adds Rubocop rule for line break after guard clause 2017-11-16 17:58:29 +01:00
build_trace_section.rb Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
build_trace_section_name.rb Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
group.rb
group_variable.rb
legacy_stage.rb
pipeline.rb Use arrays in Pipeline#latest_builds_with_artifacts 2017-11-21 17:40:29 +01:00
pipeline_schedule.rb
pipeline_schedule_variable.rb
pipeline_variable.rb
runner.rb
runner_project.rb
stage.rb
trigger.rb
trigger_request.rb
variable.rb