summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-18 16:47:47 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-18 16:47:47 +0800
commit5c1f75e983c88d4c884a15e9f84550fd256fb07f (patch)
treeafd6a6a1edd8c221fa2126018fc063ad03f6a165
parentcc91f09ac39a7c201d527734e835d01dc13e5059 (diff)
downloadgitlab-ce-5c1f75e983c88d4c884a15e9f84550fd256fb07f.tar.gz
Use ci_commits.gl_project_id instead of ci_builds.gl_project_id:
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13125513
-rw-r--r--app/models/project.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 384841dbb9a..d6e37e66a8b 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -437,10 +437,11 @@ class Project < ActiveRecord::Base
commit_object = commit(ref)
if commit_object.nil?
- builds.none
+ Ci::Build.none
else
- builds.joins(:pipeline).
- merge(Ci::Pipeline.where(sha: commit_object.sha))
+ Ci::Build.joins(:pipeline).
+ merge(Ci::Pipeline.where(sha: commit_object.sha,
+ project: self))
end
end