FIX code review
This commit is contained in:
parent
3e25a7b28c
commit
1617a541fe
|
@ -8,6 +8,6 @@ class Ci::Build < Ci::RemoteBase
|
||||||
scope :failed, -> { by_status('failure') }
|
scope :failed, -> { by_status('failure') }
|
||||||
scope :running, -> { by_status('running') }
|
scope :running, -> { by_status('running') }
|
||||||
scope :errored, -> { by_status('error') }
|
scope :errored, -> { by_status('error') }
|
||||||
scope :pending, -> { by_status('pending') }
|
scope :pending, -> { by_status('pending') }
|
||||||
scope :by_status, ->(status) { where(build_status: status) }
|
scope :by_status, ->(status) { where(build_status: status) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,21 +13,16 @@ class Ci::Builds::ListQuery < ApplicationQuery
|
||||||
def call
|
def call
|
||||||
scope = @repo.builds
|
scope = @repo.builds
|
||||||
|
|
||||||
scope =
|
builds =
|
||||||
case params[:search]
|
case params[:search]
|
||||||
when 'success'
|
when 'success' then scope.successed
|
||||||
scope.successed
|
when 'pending' then scope.pending
|
||||||
when 'pending'
|
when 'error' then scope.errored
|
||||||
scope.pending
|
when 'running' then scope.running
|
||||||
when 'error'
|
when 'failure' then scope.failed
|
||||||
scope.errored
|
|
||||||
when 'running'
|
|
||||||
scope.running
|
|
||||||
when 'failure'
|
|
||||||
scope.failed
|
|
||||||
else
|
else
|
||||||
scope
|
scope
|
||||||
end
|
end
|
||||||
custom_sort(scope, params[:sort_by], params[:sort_direction])
|
custom_sort(builds, params[:sort_by], params[:sort_direction])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue