I'm using Ember 1.0-pre4.
I have two models in one-to-one relationship:
App.Lesson = DS.Model.extend
timeslot: DS.belongsTo 'App.Timeslot'
App.Timeslot = DS.Model.extend
lesson: DS.belongsTo 'App.Lesson'
I have an adapter configured to embed timeslot into lesson upon saving:
App.Adapter = DS.RESTAdapter.extend()
App.Adapter.map App.Lesson,
timeslot: { embedded: 'always' }
App.Store = DS.Store.extend
revision: 11
adapter: App.Adapter.create()
Then I create a lesson and a time slot and try to save them:
lesson = App.Lesson.createRecord
group: group
lesson.set('timeslot', App.Timeslot.createRecord())
lesson.store.commit()
But upon saving nothing is embedded and I see to POST requests, one for lesson and one for timeslot.
How do I tell Ember to always embed timeslot into lesson?