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
Boxiang Sun
gitlab-ce
Commits
62919a17
Commit
62919a17
authored
Apr 06, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests and associations
parent
b828a98c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+5
-4
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+7
-0
No files found.
app/serializers/pipeline_serializer.rb
View file @
62919a17
...
...
@@ -13,15 +13,16 @@ class PipelineSerializer < BaseSerializer
def
represent
(
resource
,
opts
=
{})
if
resource
.
is_a?
(
ActiveRecord
::
Relation
)
resource
=
resource
.
includes
(
:project
)
resource
=
resource
.
includes
(
:pending_builds
,
:retryable_builds
,
:cancelable_statuses
,
:manual_actions
,
:artifacts
)
:artifacts
,
:trigger_requests
)
resource
=
resource
.
includes
(
pending_builds: :project
)
resource
=
resource
.
includes
(
manual_actions: :project
)
resource
=
resource
.
includes
(
artifacts: :project
)
resource
=
resource
.
includes
(
project: :namespace
)
resource
=
resource
.
includes
(
manual_actions:
{
project: :namespace
})
resource
=
resource
.
includes
(
artifacts:
{
project: :namespace
})
end
if
paginated?
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
62919a17
...
...
@@ -101,6 +101,13 @@ describe PipelineSerializer do
Ci
::
Pipeline
::
AVAILABLE_STATUSES
.
each
do
|
status
|
create_pipeline
(
status
)
end
RequestStore
.
begin!
end
after
do
RequestStore
.
end!
RequestStore
.
clear!
end
it
"verifies number of queries"
do
...
...
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