Ember.js array as model's property
I found that actually you can have array properties out of the box by just not specifying a type.
#coffeescriptAskuWhiteLabel.SomeModel = DS.Model.extend some_ids: DS.attr()
I'm using this, and when I do this
myModel.set('some_ids', [1,2,3])myModel.save()
The payload to the server is indeed my array as is.
For those, who have the same problem as me:check out this answer:
Or you can pass embedded models with hasMany relation and set custom primary key for embedded model in the adapter ('number' in my case). Look at this tests:
anArrayAttr: DS.attr('raw', { defaultValue: function() { return []; } })
From my awesome colleague 'Theron Humiston'