I am attempting to retrieve a single record - the "note" for a user.
This is in a Route:
this.store.find('note', {user_id: App.user.id}).then(function (note) {
window.console.log(note, arguments);
App.set('note', note.content[0]);
});
It works fine when a record exists already but I want to create a new record ready for saving later if the API doesn't return anything.
I have read this page in the guide but there's nothing about failure handling: http://emberjs.com/guides/models/finding-records/
What does the REST API need to return when it doesn't find a record?
How do I handle this result properly and specifically, so that when store.find doesn't return a model I can call store.createRecord?