Closed gxxcastillo closed 11 years ago
Removed the .rel() method as it is relative to the entities relationship to its parent and not to the entity itself. Currently, the only way to get an entities rel (or name) is via the parent's ._entities array:
var parent = new Backbone.Siren.Model(sirenObj);
var parentChildData = parent._entities;
The ._entities array is an array of objects that have the following properties:
Calling entity.rel() will only return the first rel in the entities rel array.
Related to issue https://github.com/kiva/backbone.siren/issues/4 : We use .rel() internally for naming a sub-entity.
I don't have any use-cases that uses multiple rels so this works fine for me so far but this behavior will probably need to be revisited at some point.