summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 88cb7e21d66..5d5939538c0 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -45,6 +45,11 @@ class CommitStatus < ActiveRecord::Base
validates_presence_of :name
+ def self.stages
+ group(:stage, :stage_idx).order(:stage_idx)
+ .pluck(:stage, :stage_idx).map(&:first)
+ end
+
alias_attribute :author, :user
scope :running, -> { where(status: 'running') }