I have multiple models representing user data (profile, settings etc). These at the moment are stored in the models folder like so;
models
-> user.js
-> profile.js
-> settings.js
What I would like to so is have a folder structure like so;
models
-> user.js
-> user (folder)
-> profile.js
-> settings.js
The user model (user.js) references the profile model (profile.js) like so;
import DS from "ember-data";
export default DS.Model.extend({
NSP: DS.attr('string'),
Status: DS.attr('string'),
Profile: DS.belongsTo('profile', {embedded: 'always'})
});
I have tried to replace the DS.belongsTo('profile', {embedded: 'always'})
with the following:
DS.belongsTo('user.profile', {embedded: 'always'})
DS.belongsTo('user/profile', {embedded: 'always'})
DS.belongsTo('user-profile', {embedded: 'always'})
but this does not work.
Am I missing something here?
Are you sure using "user/profile" doesn't work? I replicated your structure on my system and am getting "user" and "user/profile" models.
Do you have Ember Inspector installed on Firefox or Chrome? You can see the available models easily by going to the "Data" pane:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With