From bfa3bae32aacbef691b525e86f4946bb3748ff08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20PIRIO?= Date: Tue, 31 Oct 2017 14:31:14 +0100 Subject: [PATCH] Use `Ember.Copyable.detect` Use `Ember.Copyable.detect` to know if `value` extends Ember.Copyable mixin, like in https://github.com/emberjs/ember.js/blob/master/packages/ember-runtime/lib/copy.js#L93 --- addon/mixins/copyable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addon/mixins/copyable.js b/addon/mixins/copyable.js index 49cc18e..2a78955 100644 --- a/addon/mixins/copyable.js +++ b/addon/mixins/copyable.js @@ -10,7 +10,7 @@ const { guidFor, isEmpty, runInDebug, - canInvoke + Copyable } = Ember; const { @@ -139,7 +139,7 @@ export default Ember.Mixin.create({ ) { let value = this.get(name); - if (canInvoke(value, 'copy')) { + if (Copyable && Copyable.detect(value)) { // "value" is an Ember.Object using the Ember.Copyable API (if you use // the "Ember Data Model Fragments" addon and "value" is a fragment or // if use your own serializer where you deserialize a value to an