diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-02-28 05:56:18 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-03-21 07:31:29 +0300 |
commit | e3507c9282241047d4a983f6251c5692b0f9edee (patch) | |
tree | c8128c9a893d6798f6f3b55eab0e19f03275623f /app/models/ci/pipeline.rb | |
parent | 59de0443edba21a2110f783a4b2595bc02e7db0f (diff) |
Add inverse_of: :pipeline for pipeline.builds (#37987)
This appears to reduce the number of queries in pipeline creation of
gitlab-ce's .gitlab-ci.yml by 92
This also means we now need to mock this ci yaml file properly in the
test because otherwise the yaml_errors stay on the object and make all
the pipelines failed.
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r-- | app/models/ci/pipeline.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index a72a815bfe8..103c36c4668 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -14,7 +14,7 @@ module Ci has_many :stages has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id, inverse_of: :pipeline - has_many :builds, foreign_key: :commit_id + has_many :builds, foreign_key: :commit_id, inverse_of: :pipeline has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id # rubocop:disable Cop/ActiveRecordDependent has_many :variables, class_name: 'Ci::PipelineVariable' |