Follow up on technical debt for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23538
When doing https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23582 there was some technical debt such as rubocop rules violations For :id/jobs/artifacts/:ref_name/download
active record was being used directly, which is not ideal. Use an already existing method that does the same thing that we are doing.
Duplicate method names doing the same thing such as latest_successful_builds_for
& latest_successful_build_for
. latest_successful_builds_for
was always being used the same way as latest_successful_build_for
so merge the two methods into one.