diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-06 15:04:26 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-06 15:04:26 +0200 |
commit | b828a98c1c07fa07a0e80b73eadf568d68aefeea (patch) | |
tree | 32b0d89134aadf98982e73a34cc102bc79a4d6ed /app/serializers/pipeline_serializer.rb | |
parent | 8a1c12aa6f9f0f4d7815b5c7c945caadcfc5e10d (diff) | |
download | gitlab-ce-b828a98c1c07fa07a0e80b73eadf568d68aefeea.tar.gz |
Optimise includes
Diffstat (limited to 'app/serializers/pipeline_serializer.rb')
-rw-r--r-- | app/serializers/pipeline_serializer.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 7829df9fada..efeccebec41 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -13,7 +13,15 @@ class PipelineSerializer < BaseSerializer def represent(resource, opts = {}) if resource.is_a?(ActiveRecord::Relation) - resource = resource.includes(project: :namespace) + resource = resource.includes(:project) + resource = resource.includes(:pending_builds, + :retryable_builds, + :cancelable_statuses, + :manual_actions, + :artifacts) + resource = resource.includes(pending_builds: :project) + resource = resource.includes(manual_actions: :project) + resource = resource.includes(artifacts: :project) end if paginated? |