WIP: rehaul of type-safe fetching and querying

This commit is contained in:
John Estropia
2017-03-01 19:34:07 +09:00
parent 3224fcf71d
commit 8569c3c524
9 changed files with 638 additions and 390 deletions

View File

@@ -152,7 +152,16 @@ extension Bool: CoreStoreImportableAttributeType {
@inline(__always)
public static func cs_fromImportableNativeType(_ value: ImportableNativeType) -> Bool? {
return value.boolValue
switch value {
case let decimal as NSDecimalNumber:
// iOS: NSDecimalNumber(string: "0.5").boolValue // true
// OSX: NSDecimalNumber(string: "0.5").boolValue // false
return NSNumber(value: decimal.doubleValue).boolValue
default:
return value.boolValue
}
}
}