```ruby
@hostgroup = (params[:hostgroup_id] && ::Hostgroup.find_by_id(params[:hostgroup_id]) ||
    @deployment.child_hostgroups.deploy_order.first 
```
would be better