explicit id sort for relationships to prevent returning different order on each refresh #246
fixed karma test