I’ve had a number of occasions now where I want to find something in my
model that is not on the primary object. For instance I’ve got a class
Alert that has_one Status. Status has a “label”.
I want to find all of my Alert objects and order the results
alphabetically by status label.
Can I do that without going into SQL? Right now I find myself doing an
Alert.find :all, :joins=>“as a join status s on a.status_id=s.id”,
:order=>“label” (that’s from memory, sorry if there’s any syntax
but there’s gotta be a better way?