From 41a4e1ca9efd7f6b95491aec23f5a7e3b5e5eecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wo=C5=BAny?= Date: Tue, 25 Jun 2024 11:52:17 +0200 Subject: [PATCH] replace not existing removeObject method --- guides/release/models/relationships.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/release/models/relationships.md b/guides/release/models/relationships.md index 8dd64b2644..eea0b4dac3 100644 --- a/guides/release/models/relationships.md +++ b/guides/release/models/relationships.md @@ -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(); ```