Ember-Data defines languages as a read-only property because it does not want you to replace the array. Regardless of whether you save or not, Ember-Data wants you to add relationships with addObject and delete relationships with removeObject .
So, if you want to add a language, you would do the following:
model: function() { var model = this.store.createRecord('site'); var language = getLanguage(); model.get('languages').addObject(language); return model; }
What you do by supplying languages before createRecord essentially calls model.set('languages', Ember.A()) , and Ember-Data doesn't like that.
This is stupid, I know, but this is how Ember-Data works.
source share