Minor thing but I would probably DRY this:

```ruby
ids.compact!
puppet? ? PuppetModule.index_puppet_modules(ids) : Package.index_packages(ids)
```