new auto-commit transaction methods

This commit is contained in:
John Estropia committed 2017-03-31 19:44:18 +09:00
1 parent d72d1afe8b
commit 97d7a276fe
39 files changed
+3739 -3232

No files matched your search

+14 -5
View File
@@ -288,10 +288,19 @@ public extension NSError {
internal var isCoreDataMigrationError: Bool {
let code = self.code
return (code == NSPersistentStoreIncompatibleVersionHashError
|| code == NSMigrationMissingSourceModelError
|| code == NSMigrationError)
&& self.domain == NSCocoaErrorDomain
guard self.domain == CocoaError.errorDomain else {
return false
}
switch CocoaError.Code(rawValue: self.code) {
case CocoaError.Code.persistentStoreIncompatibleVersionHash,
CocoaError.Code.migrationMissingSourceModel,
CocoaError.Code.migration:
return true
default:
return false
}
}
}