summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
authorRydkin Maxim <maks.rydkin@gmail.com>2017-03-18 14:46:56 +0300
committerRydkin Maxim <maks.rydkin@gmail.com>2017-04-04 21:11:24 +0300
commita4d08e6babbbdbd44267aebdcccd2cc2c63e48ed (patch)
tree689d13927396e8af3eee7abd2fd663ee2688a410 /app/models/ci/pipeline.rb
parent40f67c1da84379e293db14b61dc7390bc4d0a4c4 (diff)
downloadgitlab-ce-a4d08e6babbbdbd44267aebdcccd2cc2c63e48ed.tar.gz
rename `auto_canceled_by` and add foreign key
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 49dec770096..5e88ba0c170 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -7,7 +7,9 @@ module Ci
belongs_to :project
belongs_to :user
+ belongs_to :auto_canceled_by, class_name: 'Ci::Pipeline'
+ has_many :auto_canceled_pipelines, class_name: 'Ci::Pipeline', foreign_key: 'auto_canceled_by_id'
has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id
has_many :builds, foreign_key: :commit_id
has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id