Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Ember generated ids on subtypes in belongsTo relationship?

$
0
0

@gjhawar wrote:

I have a ember model in which I have a belongsTo relationship like :slight_smile:

export default DS.Model.extend({
  name: DS.attr('string'),
  entityType: DS.belongsTo('entity-type', { defaultValue() { return {}; }, async: false }),

The problem is when I GET the model in the route it is assigning an ember generated id to the subtype in belongsTO relationship.
{ name: "jack" , "entityType" : { "code" : "codeA", "id" : "ember100"} }

Is there a way I can stop it from assigning an id. Is there a primary key concept for subtypes? And how to make sure these generated ids are not serialized on POST?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles