I suggest rails 3 sytnax here
```ruby 
host_groups = Hostgroup.unscoped.with_taxonomy_scope.where(conditions).joins(:puppetclasses).uniq.pluck(:id)
```
Hostgroup.unscoped.with_taxonomy_scope.where(conditions).joins(puppetclasses).uniq.pluck(:id)
```