I would like to add an employee
belongsTo a business
and a business
hasMany employees
relationship but the foreign key
is businessId
instead of business_id
. Where can I configure Ember to allow businessId
to be the foreign key?
In fact how can I make modelId
the format for all foreign keys?
we are using Ember data 1.13
, ember-cli 1.13
controllers/employee.js
import DS from 'ember-data';
export default DS.Model.extend({
business: DS.belongsTo('business', { async: true })
});
controllers/business.js
import DS from 'ember-data';
export default DS.Model.extend({
employees: DS.hasMany('employee', { async: true })
});