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 move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
legacy_stage.rb
pipeline.rb Use arrays in Pipeline#latest_builds_with_artifacts 2017-11-21 17:40:29 +01:00
pipeline_schedule.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
pipeline_schedule_variable.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
pipeline_variable.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
runner.rb Fix locked shared runners problem 2017-09-25 16:23:13 +02:00
runner_project.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
stage.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
trigger.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
trigger_request.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00
variable.rb move lib/ci/model.rb into lib/gitlab/ci/model.rb 2017-09-12 22:32:01 +03:00