For comparison:
```ruby
compute_attributes = hostgroup.
    compute_profile.
    compute_attributes.
    where(compute_resource_id: compute_resource.id).
    first.
    vm_attrs
```
```ruby
compute_attributes = hostgroup.compute_profile.compute_attributes.
    where(compute_resource_id: compute_resource.id).first.vm_attrs
```
For me the first one is a clear winner.