where('(artifacts_file IS NOT NULL AND artifacts_file <> ?) OR EXISTS (?)','',Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.ci_job_id'))
where('(artifacts_file IS NOT NULL AND artifacts_file <> ?) OR EXISTS (?)','',Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id'))
end
scope:with_artifacts_not_expired,->(){with_artifacts.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?',Time.now)}