Katello/katello — pull request #4558 by bbuckingham (2014-08-11 15:31:19+00:00)
Title: fixes #7019 / BZ 1128473 - content search - change to eliminate errors with ambiguous 'id'

This commit is to update a few queries that use 'pluck' to be explicit
on the table that the attribute (id) is being plucked from. Without them
the user can experience errors like:

Processing by Katello::ContentSearchController#packages as */*
Parameters: {"repos"=>{"autocomplete"=>[{"id"=>"13", "name"=>"samrepo"}]}, "packages"=>{"search"=>""}, "content_type"=>"packages", "mode"=>"all", "environments"=>[2], "content_search"=>{"repos"=>{"autocomplete"=>[{"id"=>"13", "name"=>"samrepo"}]}, "packages"=>{"search"=>""}, "content_type"=>"packages", "mode"=>"all", "environments"=>[2]}}
PGError: ERROR: column reference "id" is ambiguous
LINE 1: SELECT id FROM "katello_repositories" INNER JOIN "katello_co...
^
: SELECT id FROM "katello_repositories" INNER JOIN "katello_content_view_versions" ON "katello_content_view_versions"."id" = "katello_repositories"."content_view_version_id" WHERE "katello_content_view_versions"."content_view_id" IN (1, 2, 3, 4, 6) ORDER BY katello_repositories.name ASC (ActiveRecord::StatementInvalid)