actually you can simply do 
ComputeResource.find_by_id(@host.compute_resource_id) .... instead of available_cr_ids?