I am implement a discussion forum in my Ember App. I use Ember-Data with RESTAdapter for accessing the backend. I have a post model and a thread model. Thread can hasMany root posts. When I create new thread, I need to create thread and the root post.
I tried to create new record of thread with new record of post embedded and it didn’t work. Ember replaced the post with null. So when i called save on thread, I only saved the thread without any realtionship (and also no post).
What is the correct way to save thread and a post? Or what is the correct way of saving multiple models with non-trivial relationships?