README.md

This commit is contained in:
Gwendal Roué committed 2015-07-03 11:13:03 +02:00
1 parent 2e929174d2
commit 41e32e2d20
1 file changed
+3 -1
+3 -1
View File
@@ -265,7 +265,7 @@ By overriding `updateFromDatabaseRow`, you can load persons:
class Person : RowModel {
...
// Boring and not very DRY, but straightforward:
// Boring and not DRY, but straightforward and trivial:
override func updateFromDatabaseRow(row: Row) {
if row.hasColumn("id") {
id = row.value(named: "id")
@@ -277,6 +277,8 @@ class Person : RowModel {
age = row.value(named: "age")
}
if row.hasColumn("creationTimestamp") {
// The custom type DatabaseDate that we have declared above turns
// out handy:
let dbDate: DatabaseDate? = row.value(named: "creationTimestamp")
creationDate = dbDate?.date
}