this change is not technically part of issue #5173, but it is code that was in PR #1217.  `puppetclass_ids` causes error
`
PG::InvalidColumnReference: ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...vironment_classes"."environment_id" = 54 ORDER BY puppetclas...
`