From e3280aeea008d5ddaf36d8acb64a9f0a5740dde4 Mon Sep 17 00:00:00 2001 From: Axel Le Bot Date: Sat, 6 Jul 2019 18:19:19 +0200 Subject: [PATCH 1/2] [FIX] Fixed wrong relationship example --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e8f00f7a..0fe778dc 100644 --- a/README.md +++ b/README.md @@ -154,15 +154,15 @@ with custom parameters (ex. `@HasOne(foreignKey: 'foreign_id')`). @orm abstract class _Author extends Model { @hasMany // Use the defaults, and auto-compute `foreignKey` - List books; + List<_Book> books; // Also supports parameters... @HasMany(localKey: 'id', foreignKey: 'author_id', cascadeOnDelete: true) - List books; + List<_Book> books; @SerializableField(alias: 'writing_utensil') @hasOne - Pen pen; + _Pen pen; } ``` From c4e16206ea9d193dc03507874830ca8e8fc94a1e Mon Sep 17 00:00:00 2001 From: Axel Le Bot Date: Sat, 13 Jul 2019 13:20:59 +0200 Subject: [PATCH 2/2] Edited car list query --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0fe778dc..abab1df6 100644 --- a/README.md +++ b/README.md @@ -110,16 +110,18 @@ class CarController extends Controller { @Expose('/recalled_since_2008') carsRecalledSince2008(QueryExecutor executor) { // Instantiate a Car query, which is auto-generated. This class helps us build fluent queries easily. - var cars = new CarQuery(); - cars.where + var query = new CarQuery(); + query.where ..familyFriendly.equals(false) ..recalledAt.year.greaterThanOrEqualTo(2008); // Shorter syntax we could use instead... - cars.where.recalledAt.year <= 2008; + query.where.recalledAt.year <= 2008; // `get()` returns a Future>. - return await cars.get(executor); + var cars = await query.get(executor); + + return cars; } @Expose('/create', method: 'POST')