I know this question is old and answered, but since it is one of the best search results for "ember hasone" I wanted to share my findings on this issue. I read the link in the first answer, but the example is a bit outdated.
The built-in flag is deprecated, DS.RESTAdapter.map is not a function, and the DS.hasOne method is deprecated.
1.0.0-beta.2 hasOne "DS.belongsTo". , hasOne foreignKeys , ownTo.
: https://github.com/emberjs/data/commit/a466741a36731c5d382df33461268024627325ef
.
{"users": [{
"id": 1,
"name": "John Doe",
"profile": 27,
"image": 3,
"account_id": 64
}]}
App.User = DS.Model.extend({
name: DS.attr('string'),
profile: DS.belongsTo('profile'),
image: DS.belongsTo('image'),
account_id: DS.belongsTo('account')
});
, , , hasOne