Adding a method to get the associated ids of relationships.