     })
 
     let sorting: YapDB.View.Sorting = .ByObject({ (_, group, collection1, key1, object1, collection2, key2, object2) -> NSComparisonResult in
-        if  let event1 = Event.unarchive(object1),
-            let event2 = Event.unarchive(object2) {
+        if  let event1 = Event.decode(object1),
+            let event2 = Event.decode(object2) {
                 return event1.date.compare(event2.date)
         }
         return .OrderedSame


import Foundation
import YapDatabase
import YapDatabaseExtensions
import TaylorSource


    return (a.color == b.color) && (a.uuid == b.uuid) && (a.date == b.date)
}

extension Event.Color: ValueCoding {
    public typealias Coder = EventColorCoder

    enum Kind: Int {
        case Red = 1, Blue, Green
    }

    var kind: Kind {
