From 1d80fd5802ab081cd8e128691eb8f70b435c8ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 16 Dec 2015 13:55:53 +0100 Subject: [PATCH] README.md --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3e6946b73..c36c4ec1d 100644 --- a/README.md +++ b/README.md @@ -2082,14 +2082,6 @@ class PersonsViewController: UITableViewController { bookCount = row.value(named: "bookCount") super.init(row) } - - class func fetchAllWithBookCount(db: Database) -> [PersonWithBookCount] { - return fetchAll(db, - "SELECT persons.*, COUNT(books.id) AS bookCount " + - "FROM persons " + - "LEFT JOIN books ON books.ownerId = persons.id " + - "GROUP BY persons.id") - } } ``` @@ -2100,7 +2092,11 @@ Perform a single request: override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) persons = dbQueue.inDatabase { db in - PersonWithBookCount.fetchAllWithBookCount(db) + PersonWithBookCount.fetchAll(db, + "SELECT persons.*, COUNT(books.id) AS bookCount " + + "FROM persons " + + "LEFT JOIN books ON books.ownerId = persons.id " + + "GROUP BY persons.id") } tableView.reloadData() }