diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb index 0d14858ce53..cfa86cc2553 100644 --- a/app/serializers/pipeline_serializer.rb +++ b/app/serializers/pipeline_serializer.rb @@ -5,12 +5,10 @@ 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) - super(paginate(resource), opts) + super(paginate(resource.includes(project: :namespace)), opts) else super(resource, opts) end