diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-04-24 14:53:46 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-04-24 15:48:10 +0200 |
commit | c9dc51111d53aba4e456afaade4bf9ad82c4b28c (patch) | |
tree | de742fbd8de072005fef8a55f96c8092aca52ce1 /app | |
parent | d7e8bfac48e5b142348cd503f39387e9d88a3b85 (diff) | |
download | gitlab-ce-c9dc51111d53aba4e456afaade4bf9ad82c4b28c.tar.gz |
Rename stage index column name to priority column
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/stage.rb | 6 | ||||
-rw-r--r-- | app/services/ci/ensure_stage_service.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index 5a77a909b9d..9a913213bb9 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -17,7 +17,7 @@ module Ci validates :project, presence: true validates :pipeline, presence: true validates :name, presence: true - validates :index, presence: true + validates :priority, presence: true end after_initialize do @@ -25,9 +25,9 @@ module Ci end before_validation unless: :importing? do - next if index.present? + next if priority.present? - self.index = statuses.select(:stage_idx) + self.priority = statuses.select(:stage_idx) .where('stage_idx IS NOT NULL') .group(:stage_idx) .order('COUNT(*) DESC') diff --git a/app/services/ci/ensure_stage_service.rb b/app/services/ci/ensure_stage_service.rb index 447cbfd73f5..e3e3e2d03c1 100644 --- a/app/services/ci/ensure_stage_service.rb +++ b/app/services/ci/ensure_stage_service.rb @@ -42,7 +42,7 @@ module Ci def create_stage Ci::Stage.create!(name: @build.stage, - index: @build.stage_idx, + priority: @build.stage_idx, pipeline: @build.pipeline, project: @build.project) end |