# Array desarialization

**URL:** <https://discuss.emberjs.com/t/array-desarialization/6069>\
**Category:** Ember CLI\
**Created:** [August 13, 2014, 5:49am UTC](https://discuss.emberjs.com/t/array-desarialization/6069 "2014-08-13T05:49:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandosan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/nandosan/32/267_2.png) [@nandosan](https://discuss.emberjs.com/u/nandosan)\
**Post date:** [August 13, 2014, 5:49am UTC](https://discuss.emberjs.com/t/array-desarialization/6069/1 "2014-08-13T05:49:57Z")

</div>

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 `Embedded`record 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 `labelSerializer`but 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
