I am using DS.FixtureAdapter and cannot get related records using DS.belongsTo
App.User = DS.Model.extend({
login: DS.attr('string'),
profile: DS.belongsTo('App.Profile')
});
App.Profile = DS.Model.extend({
fullname: DS.attr('string'),
address: DS.attr('string'),
user: DS.belongsTo('App.User')
});
App.Router.map(function() {
this.resource('user', { path: ':user_id' });
});
App.UserRoute = Ember.Route.extend({
model: function(params) {
return App.User.find(params.user_id)
}
});
Is this just a function of the vacation adapter?
Update
These mounts look something like this:
something like that:
App.User.FIXTURES = [
{
id: 1,
login: "marlus",
profile: 1
}
];
App.Profile.FIXTURES = [
{
id: 1,
fullname: "Marlus Araujo",
address: "Rio",
user: 1
}
];
source
share