You could do fewer DB hits by just testing the validateSort method directly. But this works well too.