Skip to content

Commit

Permalink
Set not push.
Browse files Browse the repository at this point in the history
  • Loading branch information
adjohnson916 committed Nov 9, 2015
1 parent c1c7ea2 commit 449d9f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/mixins/copyable.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default Ember.Mixin.create({
} else if (rel.constructor === DS.PromiseManyArray) {

if (overwrite) {
copy.get(relName).pushObjects(overwrite);
copy.get(relName).setObjects(overwrite);
} else {
queue.push(rel.then(function(array) {
var resolvedCopies =
Expand All @@ -78,7 +78,7 @@ export default Ember.Mixin.create({
}
});
return Ember.RSVP.all(resolvedCopies).then(function(copies){
copy.get(relName).pushObjects(copies);
copy.get(relName).setObjects(copies);
});
}));
}
Expand Down Expand Up @@ -109,16 +109,16 @@ export default Ember.Mixin.create({
});

if (overwrite) {
copy.get(relName).pushObjects(overwrite);
copy.get(relName).setObjects(overwrite);
} else {
queue.push( Ember.RSVP.all(copies).then( function(resolvedCopies) {
copy.get(relName).pushObjects(resolvedCopies);
copy.get(relName).setObjects(resolvedCopies);
}));
}


} else {
copy.get(relName).pushObjects(overwrite || objs);
copy.get(relName).setObjects(overwrite || objs);
}
}

Expand Down

0 comments on commit 449d9f7

Please sign in to comment.