Skip to content

Commit 2c70c1a

Browse files
authored
Merge pull request #2038 from wozny1989/patch-1
Replace not existing `removeObject` method
2 parents 76c870f + 41a4e1c commit 2c70c1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/release/models/relationships.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ It is also possible to remove a record from a `hasMany` relationship:
466466

467467
```javascript
468468
let blogPost = this.store.peekRecord('blog-post', 1);
469-
let comment = this.store.peekRecord('comment', 1);
469+
let commentToRemove = this.store.peekRecord('comment', 1);
470470
let comments = await blogPost.comments;
471-
comments.removeObject(comment);
471+
blockPost.comments = comments.filter((comment) => comment !== commentToRemove);
472472
blogPost.save();
473473
```
474474

0 commit comments

Comments
 (0)