Commit b5dfd03e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Include resources to speed up pipelines serializer

parent ae5dc479
......@@ -12,7 +12,6 @@ class Projects::PipelinesController < Projects::ApplicationController
.execute(scope: @scope)
.page(params[:page])
.per(30)
.includes(project: :namespace)
@running_or_pending_count = PipelinesFinder
.new(project).execute(scope: 'running').count
......
......@@ -20,7 +20,6 @@ class PipelinesFinder
end
scoped_pipelines.order(id: :desc)
.includes(project: [:namespace])
end
private
......
......@@ -5,6 +5,8 @@ class PipelineSerializer < BaseSerializer
Struct.new('Pagination', :request, :response)
def represent(resource, opts = {})
resource = resource.includes(project: :namespace)
if paginated?
raise InvalidResourceError unless resource.respond_to?(:page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment