diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-06-02 19:57:40 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-06-06 21:58:13 -0300 |
commit | c698f10942ebdf44d0c2a6559277bc6a89d26c5b (patch) | |
tree | 3926a0552ad7deaf1464cf93f4d8bd1569bb9dec /app/serializers | |
parent | de3e1bb4ecccaf6d5dfa26140cbfc567dd998979 (diff) | |
download | gitlab-ce-c698f10942ebdf44d0c2a6559277bc6a89d26c5b.tar.gz |
Avoid repeated queries for pipeline builds on merge requestsissue_27166_2
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index e37af63774c..e99dc6e7ebc 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -13,14 +13,15 @@ class PipelineSerializer < BaseSerializer def represent(resource, opts = {}) if resource.is_a?(ActiveRecord::Relation) + resource = resource.preload([ :retryable_builds, :cancelable_statuses, :trigger_requests, :project, - { pending_builds: :project }, - { manual_actions: :project }, - { artifacts: :project } + :manual_actions, + :artifacts, + { pending_builds: :project } ]) end |