As far as I can tell, this is one of several major reasons why Ember Data is marked as not “production ready” on the website:
Is It “Production Ready™”?
No. The API should not be considered stable until 1.0.
I’ve actually used Ember Data successfully in a real production project despite this warning, and it’s actually a great library in many ways. But it’s far from finished—there are no validations, HTTP error-handling is shaky at best, reloading models is tricky, and I’ve hit one or two really nasty bugs.
There are several ways to use Ember.js without having Ember Data wreck your life:
- Use
$.ajax
calls from within themodel
method on your router, and roll your own very simplistic models using Ember.Object. I think I heard that Discourse does quite a bit of this. - Use
ember-rest
orember-resource
instead of Ember Data. I haven’t tried either, but they look like they’re much simpler (and less featureful) than Ember Data. - Feed Ember Data exactly the JSON it wants, and stop trying to fight it. This is what I ended up doing, with excellent results. In your case, this means that, yes, you need to always send the association IDs with the models, at least until this part of Ember Data gets implemented.
The root of your problems is that you’re treating Ember Data like production-ready code, when it’s really a very nice prototype that can be made to work, but only if you don’t ask it to do anything too strange. Once I was forced to make this attitude adjustment, I actually got pretty good results with it.