From dfcb44016f2c499398ba679f88472a6912779b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 21 Jan 2018 15:19:55 +0100 Subject: [PATCH] Enhance CHANGELOG --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72e050ecf..907927658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Release Notes **New** -- The RecordBox class brings changes tracking to any record type ([documentation](https://github.com/groue/GRDB.swift/blob/master/README.md#recordbox-class)): +- The new RecordBox class brings changes tracking to any record type ([documentation](https://github.com/groue/GRDB.swift/blob/master/README.md#recordbox-class)): ```swift // A regular record struct @@ -13,15 +13,16 @@ Release Notes try dbQueue.inDatabase { db in // Fetch a boxed player - if let player = try RecordBox.fetchOne(db, key: 1) { - player.value.score = 300 + if let boxedPlayer = try RecordBox.fetchOne(db, key: 1) { + // boxedPlayer.value is Player + boxedPlayer.value.score = 300 - if player.hasPersistentChangedValues { + if boxedPlayer.hasPersistentChangedValues { print("player has been modified") } // Does nothing if player has not been modified: - try player.updateChanges(db) + try boxedPlayer.updateChanges(db) } } ```