Now we could use normal relation, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13173842
This commit is contained in:
Lin Jen-Shin 2016-07-20 01:08:16 +08:00
parent 0465876197
commit 091142118e

View file

@ -431,8 +431,7 @@ class Project < ActiveRecord::Base
# ref can't be HEAD, can only be branch/tag name or SHA
def latest_successful_builds_for(ref = default_branch)
Ci::Build.joins(:pipeline).
merge(pipelines.latest_successful_for(ref)).
builds.where(pipeline: pipelines.latest_successful_for(ref)).
latest_successful_with_artifacts
end