Bug #2579
closedHost groups with puppet classes triggers: column 'id' in field list is ambiguous
Description
When creating host groups with puppet classes or similar, AR doesn't supply the correct field name in the pluck when joining tables:
2.0.0p0 :020 > Hostgroup.first.puppetclass_ids
Hostgroup Load (39.7ms) SELECT `hostgroups`.* FROM `hostgroups` WHERE (1=1) LIMIT 1
(37.6ms) SELECT id FROM `puppetclasses` INNER JOIN `hostgroup_classes` ON `hostgroup_classes`.`puppetclass_id` = `puppetclasses`.`id` INNER JOIN `hostgroups` ON `hostgroups`.`id` = `hostgroup_classes`.`hostgroup_id` WHERE `hostgroups`.`id` IN (1)
ActiveRecord::StatementInvalid: Mysql::Error: Column 'id' in field list is ambiguous: SELECT id FROM `puppetclasses` INNER JOIN `hostgroup_classes` ON `hostgroup_classes`.`puppetclass_id` = `puppetclasses`.`id` INNER JOIN `hostgroups` ON `hostgroups`.`id` = `hostgroup_classes`.`hostgroup_id` WHERE `hostgroups`.`id` IN (1)
This is only in 3.2.8 (RPMs), not 3.2.13 (source). Looks like: https://github.com/rails/rails/issues/5990