From cc5e55a98f27a18a6ba099e6d28886608208994e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Andre=CC=81s=20Di=CC=81az=20Vergara?= Date: Fri, 30 Jun 2017 16:45:15 -0400 Subject: [PATCH] Fixes creation with nested observable attributes --- src/Collection.js | 2 +- src/Model.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Collection.js b/src/Collection.js index 4bdb0bb..450ba73 100644 --- a/src/Collection.js +++ b/src/Collection.js @@ -210,7 +210,7 @@ export default class Collection { ): Promise<*> { let model let attributes = attributesOrModel instanceof Model - ? attributesOrModel.attributes.toJS() + ? attributesOrModel.toJS() : attributesOrModel const label: Label = 'creating' diff --git a/src/Model.js b/src/Model.js index e0d541b..19c7145 100644 --- a/src/Model.js +++ b/src/Model.js @@ -203,7 +203,7 @@ export default class Model { if (this.collection) { return this.collection.create(this, { optimistic }) } else { - return this._create(this.attributes.toJS(), { optimistic }) + return this._create(this.toJS(), { optimistic }) } }