From 6cdcd97912b8334d1153d6efdfc754cd83f856e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 31 May 2018 08:21:07 +0200 Subject: [PATCH] Associations documentation --- Documentation/AssociationsBasics.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/AssociationsBasics.md b/Documentation/AssociationsBasics.md index f585338ee..2f1d5e907 100644 --- a/Documentation/AssociationsBasics.md +++ b/Documentation/AssociationsBasics.md @@ -305,7 +305,7 @@ This sample code only works if the database table for authors is called "author" If the database schema does not follow this convention, and has, for example, database tables named with plural names (`authors` and `books`), you can still use associations. But you need to help row consumption by providing the required key: ```swift -// Setup for a customized table name +// Setup for customized table names struct Author: FetchableRecord, TableRecord { // Customized table name @@ -313,6 +313,9 @@ struct Author: FetchableRecord, TableRecord { } struct Book: FetchableRecord, TableRecord { + // Customized table name + static let databaseTableName = "books" + // Explicit association key static let author = belongsTo(Author.self, key: "author") }