diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-05-22 14:03:42 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-05-22 14:03:42 +0300 |
commit | fb706d69abb2bb8f07f78b2a14206027f062cc30 (patch) | |
tree | 026d28e4664e36525894d9807f6123e2fabb2804 /app/models/ci | |
parent | 6c63f96e0a26fa046fb0cc4664240e37db8b37d8 (diff) |
Order pipeline stages by a position in a relation
Diffstat (limited to 'app/models/ci')
-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 9462afe9e71..774d5eb8125 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -13,7 +13,7 @@ module Ci belongs_to :auto_canceled_by, class_name: 'Ci::Pipeline' belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule' - has_many :stages, inverse_of: :pipeline # -> { order(position: :asc) }, inverse_of: :pipeline + has_many :stages, -> { order(position: :asc) }, inverse_of: :pipeline has_many :statuses, 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 |