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)
Related issues
Bug #7019: Content Search - package is not functional
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)