From 449d9f7c59cfc05fdd63098111ebeffc117eaf47 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Mon, 9 Nov 2015 03:13:10 -0600 Subject: [PATCH] Set not push. --- addon/mixins/copyable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/mixins/copyable.js b/addon/mixins/copyable.js index 3846966..0d0a8c4 100644 --- a/addon/mixins/copyable.js +++ b/addon/mixins/copyable.js @@ -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 = @@ -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); }); })); } @@ -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); } }