From c9dc51111d53aba4e456afaade4bf9ad82c4b28c Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 24 Apr 2018 14:53:46 +0200 Subject: Rename stage index column name to priority column --- app/models/ci/stage.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models') 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') -- cgit v1.2.1