Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
2d154cee
Commit
2d154cee
authored
Jan 24, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move processables scope into commit status class
parent
287c6ed1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/commit_status.rb
app/models/commit_status.rb
+1
-0
No files found.
app/models/ci/pipeline.rb
View file @
2d154cee
...
...
@@ -25,7 +25,7 @@ module Ci
has_many
:stages
,
->
{
order
(
position: :asc
)
},
inverse_of: :pipeline
has_many
:statuses
,
class_name:
'CommitStatus'
,
foreign_key: :commit_id
,
inverse_of: :pipeline
has_many
:processables
,
->
{
where
(
type:
%w[Ci::Build Ci::Bridge]
)
},
has_many
:processables
,
->
{
processables
},
class_name:
'CommitStatus'
,
foreign_key: :commit_id
,
inverse_of: :pipeline
has_many
:builds
,
foreign_key: :commit_id
,
inverse_of: :pipeline
has_many
:trigger_requests
,
dependent: :destroy
,
foreign_key: :commit_id
# rubocop:disable Cop/ActiveRecordDependent
...
...
app/models/commit_status.rb
View file @
2d154cee
...
...
@@ -41,6 +41,7 @@ class CommitStatus < ActiveRecord::Base
scope
:latest_ordered
,
->
{
latest
.
ordered
.
includes
(
project: :namespace
)
}
scope
:retried_ordered
,
->
{
retried
.
ordered
.
includes
(
project: :namespace
)
}
scope
:after_stage
,
->
(
index
)
{
where
(
'stage_idx > ?'
,
index
)
}
scope
:processables
,
->
{
where
(
type:
%w[Ci::Build Ci::Bridge]
)
}
# We use `CommitStatusEnums.failure_reasons` here so that EE can more easily
# extend this `Hash` with new values.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment