with_status to only_status

This commit is contained in:
Shinya Maeda 2017-03-10 18:30:39 +09:00
parent 170e542369
commit 2b33e9eeb6
7 changed files with 7 additions and 7 deletions

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
class BuildSerializer < BaseSerializer
entity BuildEntity
def with_status
def only_status
tap { @status_only = { only: [{ details: [:status] }] } }
end

View file

@ -11,7 +11,7 @@ class PipelineSerializer < BaseSerializer
@paginator.present?
end
def with_status
def only_status
tap { @status_only = { only: [{ details: [:status] }] } }
end

View file

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

View file

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