Skip to content

Commit

Permalink
Fixes creation with nested observable attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rdiazv committed Jun 30, 2017
1 parent ece3b14 commit cc5e55a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default class Collection<T: Model> {
): Promise<*> {
let model
let attributes = attributesOrModel instanceof Model
? attributesOrModel.attributes.toJS()
? attributesOrModel.toJS()
: attributesOrModel
const label: Label = 'creating'

Expand Down
2 changes: 1 addition & 1 deletion src/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}

Expand Down

0 comments on commit cc5e55a

Please sign in to comment.