I would move the .uniq to be part of query, if you do it after pluck you would do in memory uniq, vs if you do it before.
probably long term better to try, pluck('DISTINCT puppetclass_id')