From db84428b5edbcefb0061e9c5debc7ae5528dd424 Mon Sep 17 00:00:00 2001 From: silverqx Date: Sun, 28 May 2023 08:44:08 +0200 Subject: [PATCH] docs used new with() and load() overloads --- docs/tinyorm/collections.mdx | 2 +- docs/tinyorm/relationships.mdx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tinyorm/collections.mdx b/docs/tinyorm/collections.mdx index bef164212..33fa5e42a 100644 --- a/docs/tinyorm/collections.mdx +++ b/docs/tinyorm/collections.mdx @@ -383,7 +383,7 @@ You can also call all `last` overloads provided by the [`QList::last`](https://d The `load` method eager loads the given relationships for all models in the collection: - users.load({{"comments"}, {"posts"}}); + users.load({"comments", "posts"}); users.load("comments.author"); diff --git a/docs/tinyorm/relationships.mdx b/docs/tinyorm/relationships.mdx index dfac0a84f..6f8e4b320 100644 --- a/docs/tinyorm/relationships.mdx +++ b/docs/tinyorm/relationships.mdx @@ -978,7 +978,7 @@ select * from authors where id in (1, 2, 3, 4, 5, ...) Sometimes you may need to eager load several different relationships. To do so, just pass a `QVector` of relationships to the `with` method: - auto books = Book::with({{"author"}, {"publisher"}})->get(); + auto books = Book::with({"author", "publisher"})->get(); #### Nested Eager Loading @@ -1071,7 +1071,7 @@ Sometimes you may need to eager load a relationship after the parent model has a You may load more relationships at once, to do so, just pass a `QVector` of relationships to the `load` method: - Book::find(1)->load({{"author"}, {"publisher"}}); + Book::find(1)->load({"author", "publisher"}); :::note So far, this only works on models, not on containers returned from Model's `get` or `all` methods.