Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
0e1b3dc4
Commit
0e1b3dc4
authored
May 25, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipelines serializer with preloading pagination
parent
f0d7445b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+4
-4
No files found.
app/serializers/pipeline_serializer.rb
View file @
0e1b3dc4
...
...
@@ -3,10 +3,6 @@ class PipelineSerializer < BaseSerializer
entity
PipelineDetailsEntity
def
represent
(
resource
,
opts
=
{})
if
paginated?
&&
!
resource
.
respond_to?
(
:page
)
raise
Gitlab
::
Serializer
::
Pagination
::
InvalidResourceError
end
if
resource
.
is_a?
(
ActiveRecord
::
Relation
)
resource
=
resource
.
preload
([
:stages
,
...
...
@@ -20,6 +16,10 @@ class PipelineSerializer < BaseSerializer
])
end
if
paginated?
resource
=
paginator
.
paginate
(
resource
)
end
if
opts
.
delete
(
:preload
)
resource
=
Gitlab
::
Ci
::
Pipeline
::
Preloader
.
preload!
(
resource
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment