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
|
def status
|
||||||
render json: BuildSerializer
|
render json: BuildSerializer
|
||||||
.new(project: @project, user: @current_user)
|
.new(project: @project, user: @current_user)
|
||||||
.with_status
|
.only_status
|
||||||
.represent(@build)
|
.represent(@build)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
||||||
def status
|
def status
|
||||||
render json: PipelineSerializer
|
render json: PipelineSerializer
|
||||||
.new(project: @project, user: @current_user)
|
.new(project: @project, user: @current_user)
|
||||||
.with_status
|
.only_status
|
||||||
.represent(@merge_request.head_pipeline)
|
.represent(@merge_request.head_pipeline)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ class Projects::PipelinesController < Projects::ApplicationController
|
||||||
def status
|
def status
|
||||||
render json: PipelineSerializer
|
render json: PipelineSerializer
|
||||||
.new(project: @project, user: @current_user)
|
.new(project: @project, user: @current_user)
|
||||||
.with_status
|
.only_status
|
||||||
.represent(@pipeline)
|
.represent(@pipeline)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class BuildSerializer < BaseSerializer
|
class BuildSerializer < BaseSerializer
|
||||||
entity BuildEntity
|
entity BuildEntity
|
||||||
|
|
||||||
def with_status
|
def only_status
|
||||||
tap { @status_only = { only: [{ details: [:status] }] } }
|
tap { @status_only = { only: [{ details: [:status] }] } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ class PipelineSerializer < BaseSerializer
|
||||||
@paginator.present?
|
@paginator.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_status
|
def only_status
|
||||||
tap { @status_only = { only: [{ details: [:status] }] } }
|
tap { @status_only = { only: [{ details: [:status] }] } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe BuildSerializer do
|
||||||
context 'when used with status' do
|
context 'when used with status' do
|
||||||
let(:serializer) do
|
let(:serializer) do
|
||||||
described_class.new(user: user)
|
described_class.new(user: user)
|
||||||
.with_status
|
.only_status
|
||||||
end
|
end
|
||||||
let(:resource) { create(:ci_build) }
|
let(:resource) { create(:ci_build) }
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ describe PipelineSerializer do
|
||||||
context 'when used with status' do
|
context 'when used with status' do
|
||||||
let(:serializer) do
|
let(:serializer) do
|
||||||
described_class.new(user: user)
|
described_class.new(user: user)
|
||||||
.with_status
|
.only_status
|
||||||
end
|
end
|
||||||
let(:resource) { create(:ci_empty_pipeline) }
|
let(:resource) { create(:ci_empty_pipeline) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue