Array desarialization


#1

I’ve a problem deserializing an array with ember-cli and ember data. I’ve models such as:

Label=DS.Model.extend
   ..
   days:DS.hasMany('day')

Day = DS.Model.extend
    hours: DS.attr()

The received JSON is:

labels:[
  {
   id: 1
   days:[{
      hours: [1,10, 33, 44,55,21]
   }]
  }
]

Now: I can properly manage Embeddedrecord with EmbeddedREcordMixin but whenever an hours array is deserialized it is transformed into something like:

[0,0,0,0,1,0,0,0,1,0,0,0,0]

removing all original values.

I tryed defining a specific transform, or changing the relationship to async and normalizing the payload in a specific labelSerializerbut nothing seems to have effect and I wasn’t able to identify where the array is actually modified…

PD: the basic approach with embedded records and DS.attr() for the array is perfectly working on plain ember. I’m using in both cases, EmberData 1.0.0-beta8 and ember 1.6.1