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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1d759895
Commit
1d759895
authored
Mar 23, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move conditional statement to PipelineSerializer#represent_status
parent
a375d80e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
1 deletion
+1
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+1
-0
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
1d759895
...
@@ -474,7 +474,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -474,7 +474,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
def
pipeline_status
def
pipeline_status
render
json:
{}
and
return
unless
@merge_request
.
head_pipeline
.
present?
render
json:
PipelineSerializer
render
json:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
new
(
project:
@project
,
user:
@current_user
)
.
represent_status
(
@merge_request
.
head_pipeline
)
.
represent_status
(
@merge_request
.
head_pipeline
)
...
...
app/serializers/pipeline_serializer.rb
View file @
1d759895
...
@@ -24,6 +24,7 @@ class PipelineSerializer < BaseSerializer
...
@@ -24,6 +24,7 @@ class PipelineSerializer < BaseSerializer
end
end
def
represent_status
(
resource
)
def
represent_status
(
resource
)
return
{}
unless
resource
.
present?
data
=
represent
(
resource
,
{
only:
[{
details:
[
:status
]
}]
})
data
=
represent
(
resource
,
{
only:
[{
details:
[
:status
]
}]
})
data
.
dig
(
:details
,
:status
)
||
{}
data
.
dig
(
:details
,
:status
)
||
{}
end
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