[FIX] Fixed wrong relationship example

This commit is contained in:
Axel Le Bot 2019-07-06 18:19:19 +02:00 committed by GitHub
parent 1b3e66d1dd
commit e3280aeea0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<Book> books;
List<_Book> books;
// Also supports parameters...
@HasMany(localKey: 'id', foreignKey: 'author_id', cascadeOnDelete: true)
List<Book> books;
List<_Book> books;
@SerializableField(alias: 'writing_utensil')
@hasOne
Pen pen;
_Pen pen;
}
```