BelongsTo to many types of models


#1

Is it possible to create a BelongsTo relationship on the same field to many Different model types.

For example, I have a Model “attachment” which holds a file, this attachment is represented in the database with one table, and is attached to a single model. However it is model agnostic, it can be attached to any different type of model. My back-end (Drupal 8) allows this, I’m wondering if Ember does too?


#2

For future reference, or googlers landing on this question:

After some digging around, this is possible with Polymorphic relationships, although at the moment not properly documented in the guides. And the blog post i’m referring is rather old, it should still work: