mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
ADD paginate for builds api
This commit is contained in:
@@ -3,4 +3,11 @@ class Ci::Build < Ci::RemoteBase
|
||||
|
||||
belongs_to :repo, foreign_key: :build_repo_id
|
||||
has_many :stages, foreign_key: "stage_build_id", dependent: :destroy
|
||||
|
||||
scope :successed, ->{ by_status('success') }
|
||||
scope :failed, -> { by_status('failure') }
|
||||
scope :running, -> { by_status('running') }
|
||||
scope :errored, -> { by_status('error') }
|
||||
scope :pending, -> { by_status('pending') }
|
||||
scope :by_status, ->(status) { where(build_status: status) }
|
||||
end
|
||||
|
||||
@@ -16,4 +16,11 @@ class Ci::Repo < Ci::RemoteBase
|
||||
[user, repo]
|
||||
end
|
||||
|
||||
def enable
|
||||
update_column(:repo_config, '.trustie-pipeline.yml')
|
||||
end
|
||||
|
||||
def activate
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user