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
Boxiang Sun
gitlab-ce
Commits
c7a7ef04
Commit
c7a7ef04
authored
Jul 20, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a new stage_id reference to a persisted stage
parent
9c10683b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
app/models/commit_status.rb
app/models/commit_status.rb
+1
-3
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+4
-3
No files found.
app/models/commit_status.rb
View file @
c7a7ef04
...
...
@@ -43,9 +43,7 @@ class CommitStatus < ActiveRecord::Base
# `ci_builds.stage` attribute and migrate `ci_builds.stage_id` reference in
# one of upcoming releases.
#
def
stage_entity
Ci
::
Stage
.
find_by
(
pipeline:
pipeline
,
name:
stage
)
end
belongs_to
:stage_entity
,
foreign_key: :stage_id
,
class_name:
'Ci::Stage'
state_machine
:status
do
event
:enqueue
do
...
...
spec/models/commit_status_spec.rb
View file @
c7a7ef04
...
...
@@ -409,9 +409,10 @@ describe CommitStatus, :models do
end
describe
'#stage_entity'
do
let!
(
:stage
)
do
create
(
:ci_stage_entity
,
pipeline:
commit_status
.
pipeline
,
name:
commit_status
.
stage
)
let
(
:stage
)
{
create
(
:ci_stage_entity
)
}
let
(
:commit_status
)
do
create
(
:commit_status
,
stage_id:
stage
.
id
)
end
it
'has a correct association with persisted stage'
do
...
...
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