with_status to only_status
This commit is contained in:
parent
170e542369
commit
2b33e9eeb6
7 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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) }
|
||||
|
||||
|
|
Loading…
Reference in a new issue