Ancestry / belongsTo Itself


#1

Is there anyway in Ember Data to have a model ‘belongTo itself’? And if not currently, would that be a worthy addition?

For example, I am working with a groups concept where if a user is in Group 1, they are also in the larger Group 2.

Here’s a JSBin of what I think seems like a decent Ember Data concept.

Here is what I manually did to get it working.

I’d appreciate any other ideas…


Reflexive relationships
#2

The thing you’re talking about is called a “Self-Join.” I found an old SO thread that offers a workaround. I almost never use these kinds of relationships, but I agree that it would be cool to have some native support for it.