Setting foreignKey of Ember Data model

Sunday, May 4, 2014

It looks like during Revision 3 of Ember Data 1, you could set the foreign key:



App.Model = DS.Model.extend({
namingConvention: {
// LOUD NAMING CONVENTION
// Changes fooKey to FOOKEY
keyToJSONKey: function(key) {
return key.toUpperCase();
},

// Determines the name of foreign keys in
// belongsTo relationships
foreignKey: function(key) {
return key.toUpperCase()+"_ID";
}
}
});


That does not seem to work now (currently Revision 7). How do you set the foreign key?







http://ift.tt/1fH36nI