summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-20 12:56:27 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-20 12:56:27 +0200
commitc7a7ef044cf79dcd5ffd25b9fb325cd0abd612b2 (patch)
tree87d072262b64d8ccb89b4b9ce00bac497b912c95 /app/models/commit_status.rb
parent9c10683b01f9b32275a04bf9ed4e84795a527db7 (diff)
downloadgitlab-ce-c7a7ef044cf79dcd5ffd25b9fb325cd0abd612b2.tar.gz
Use a new stage_id reference to a persisted stage
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index afdc75f75fb..efb5cbd9d41 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -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