Simpler two queries than one JOIN with subquery
This is a follow up from !5347 (merged)
Originally it was:
pipeline = pipelines.latest_successful_for(ref)
builds.where(pipeline: pipeline).latest.with_artifacts
However MySQL would complain that we can't use IN
against a subquery which has LIMIT
. Using INNER JOIN
would be a workaround, however, doing that is too complicated in current version of Rails.
So let's just use two queries in this case.
Closes #14419 (closed)