ordering of ar objects only when ids are present