summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-12 19:57:54 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-12 20:37:57 +0200
commit8e84acbf2e7e306ba937aaae87cfed35d2632e10 (patch)
tree40a530e78e7b0be13cbd18435bb7105fb9a3eb2c /app/models/ci/commit.rb
parent89f0dc713ca07fe935fa9ce2c31d0ca6febb5d6c (diff)
downloadgitlab-ce-8e84acbf2e7e306ba937aaae87cfed35d2632e10.tar.gz
Optimise CI status accessor
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 94951ced1fd..8865bd76bd2 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -44,8 +44,12 @@ module Ci
sha[0...8]
end
+ def self.stages
+ CommitStatus.where(commit: all).stages
+ end
+
def stages
- statuses.group(:stage).order(:stage_idx).pluck(:stage)
+ statuses.stages
end
def project_id