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
Updated by Dominic Cleal over 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Dominic Cleal over 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 65f764d6081b04cd03fa56a78e6281b5221b0bac.
Updated by Dominic Cleal almost 11 years ago
- Related to Bug #3122: when fact filters are added to a user, error column reference "id" is ambiguous for dashboard and fact_values added
Updated by Dominic Cleal almost 11 years ago
- Related to Bug #3863: when fact filters are added to a user, error column reference "id" is ambiguous for fact_values added