How to get the "modelName" of a polymorphic relationship "belongsTo"

Thank you, it’s so simple :slight_smile:

i found a simple way to get modelName: add a CP in my Attachment model like this:

// Attachment model
export default DS.Model.extend({
  modelName: Ember.computed.alias('constructor.modelName')
});

So i can use {{email.attachment.modelName}} (= “doc” OR “image”).

3 Likes