Commit 2b33e9ee authored by Shinya Maeda's avatar Shinya Maeda

with_status to only_status

parent 170e5423
......@@ -76,7 +76,7 @@ class Projects::BuildsController < Projects::ApplicationController
def status
render json: BuildSerializer
.new(project: @project, user: @current_user)
.with_status
.only_status
.represent(@build)
end
......
......@@ -476,7 +476,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def status
render json: PipelineSerializer
.new(project: @project, user: @current_user)
.with_status
.only_status
.represent(@merge_request.head_pipeline)
end
......
......@@ -75,7 +75,7 @@ class Projects::PipelinesController < Projects::ApplicationController
def status
render json: PipelineSerializer
.new(project: @project, user: @current_user)
.with_status
.only_status
.represent(@pipeline)
end
......
class BuildSerializer < BaseSerializer
entity BuildEntity
def with_status
def only_status
tap { @status_only = { only: [{ details: [:status] }] } }
end
......
......@@ -11,7 +11,7 @@ class PipelineSerializer < BaseSerializer
@paginator.present?
end
def with_status
def only_status
tap { @status_only = { only: [{ details: [:status] }] } }
end
......
......@@ -13,7 +13,7 @@ describe BuildSerializer do
context 'when used with status' do
let(:serializer) do
described_class.new(user: user)
.with_status
.only_status
end
let(:resource) { create(:ci_build) }
......
......@@ -97,7 +97,7 @@ describe PipelineSerializer do
context 'when used with status' do
let(:serializer) do
described_class.new(user: user)
.with_status
.only_status
end
let(:resource) { create(:ci_empty_pipeline) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment