I’m using ember-data with express.js on the server and a mysql backend. The problem is that my existing database structure uses a prefix for the id column:
DS.RESTAdapter.map('App.Order', {
primaryKey: 'ord_id',
});
App.store = DS.Store.create({
revision: 7,
adapter: DS.RESTAdapter.create({
bulkCommit: false
})
});
App.Order = DS.Model.extend();
It seems that ember-data requires an ‘id’ field. Is there a way to map it to my ‘ord_id’?
EDIT: I had to define the map before using it.
Check this out:
https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md
This is part of ember data, revision 5. I think this is what you need to do…