not sure why you need the host object at all.

```ruby
Puppetclass.joins(:host_classes).where(:host_classes => {:host_id => host_id})
```