Include pipeline-related resources if using relation

This commit is contained in:
Grzegorz Bizon 2017-01-05 18:25:35 +01:00
parent 0d15c8b3d4
commit e4da8b11a2

View file

@ -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