On 27 April 2013 00:30, Niv Sardi <notifications@github.com> wrote:
>
> In public/js/views/medialist.js:
>
> > @@ -65,8 +65,11 @@ window.MediaListView = function(options){
> >          allowDrop: allow_drop,
> >
> >          dragHandler: function(item, event, ui){
> > -            var piece = new Media.Piece(item.model().attributes);
> > -            piece.set('checksum', item.model().get('_id'));
> > +            var attrs = _.clone(item.model().attributes);
> > +            var id = attrs['_id'];
> > +            delete attrs['_id'];
> > +            var piece = new Media.Piece(attrs);
>
> this is wrong...
> set the id in initialize...
> so we don't need this messy code.


Again, we talked about this and we merged a wrong branch before.

We do not want the Piece id to be the same as the Media (item in this
case). And I certainly don't want to touch the item because it leads
to a lot of fun, that's why I clone the attributes before filtering.