                 return collection
             }
 
-            if let event = Event.unarchive(object) {
+            if let event = Event.decode(object) {
                 return event.color.description
             }
         }

    })

    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) {
                return event1.date.compare(event2.date)
        }
        return .OrderedSame

    }
}

extension Event: ValueCoding {
    public typealias Coder = EventCoder
}

public class EventCoder: NSObject, NSCoding, CodingType {

    public let value: Event

