I agree it's not clean, but I thought doing the sorting everytime you call ".all" on the Hostgroup model might be adding too much overhead. Sorting by "name" is not possible because it won't take the full hostgroup name. Overriding the .name will break things and it's not a good solution either.. I'm not clear what to do with this to make it a little more elegant.