Skip to content

Commit

Permalink
Merge pull request #2038 from wozny1989/patch-1
Browse files Browse the repository at this point in the history
Replace not existing `removeObject` method
  • Loading branch information
IgnaceMaes authored Jun 29, 2024
2 parents 76c870f + 41a4e1c commit 2c70c1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/release/models/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@ It is also possible to remove a record from a `hasMany` relationship:

```javascript
let blogPost = this.store.peekRecord('blog-post', 1);
let comment = this.store.peekRecord('comment', 1);
let commentToRemove = this.store.peekRecord('comment', 1);
let comments = await blogPost.comments;
comments.removeObject(comment);
blockPost.comments = comments.filter((comment) => comment !== commentToRemove);
blogPost.save();
```

Expand Down

0 comments on commit 2c70c1a

Please sign in to comment.