gitlab-org--gitlab-foss/spec/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_spec.rb Fix the external URLs generated for online view of HTML artifacts 2017-10-20 23:38:35 +01:00
build_spec.rb Add doc. Fix spec. Add erase_build in protected_ref rule 2017-11-07 02:47:05 +09:00
build_trace_section_name_spec.rb Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
build_trace_section_spec.rb Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
group_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
group_variable_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
legacy_stage_spec.rb Remove superfluous type defs in specs 2017-07-27 14:31:52 +02:00
pipeline_schedule_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00
pipeline_schedule_variable_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
pipeline_spec.rb Use arrays in Pipeline#latest_builds_with_artifacts 2017-11-21 17:40:29 +01:00
pipeline_variable_spec.rb Support custom attributes on users 2017-09-28 16:49:42 +00:00
runner_spec.rb Fix locked shared runners problem 2017-09-25 16:23:13 +02:00
stage_spec.rb Set a default CI/CD status when it is not known 2017-08-22 14:04:34 +02:00
trigger_request_spec.rb Fix trigger_request.variables 2017-09-04 21:55:26 +09:00
trigger_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
variable_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00