Embedded records for all relations


#1

I’ve just tried the EmbeddedRecords mixin for the first time and it works flawless!

Yet, do I need to add a serializer for all models in the project, or is there a way to make embedded records the default for any API call?

I tried this on the application serializer:

export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
  
  attrs: {
    person: { embedded: 'always' }
  }
  
});

But this gives the next warning for any model without a relation with person:

WARNING: There is no attribute or relationship with the name `person` on `...`. Check your serializers attrs hash.

#2

All models have person attribute??

If no, so it’s wrong you put that in your application serializer


#3

Yeah, I understand that.

My question is, since our back-end will always embed any relationship in any API call, is there a way in Ember to configurate the Ember app so it understands that, instead of having to create a serializer for every single model?