commits = DB[<<-SQL, params[:name]].all
SELECT DISTINCT ON (pod_versions.id)
pods.name "name",
pod_versions.name "version",
commits.sha "sha",
commits.created_at "created_at"
FROM
pods
LEFT JOIN
pod_versions ON pods.id = pod_versions.pod_id
INNER JOIN
commits ON pod_versions.id = commits.pod_version_id
WHERE
pods.name = ? AND pods.deleted is false AND pod_versions.deleted is false
ORDER BY
pod_versions.id
SQL
Right now there's a pretty chunky query going on:
Could this be replaced by the GH API?