mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-29 20:17:09 +02:00
XCode7 beta 6 updates
This commit is contained in:
@@ -80,12 +80,10 @@ public extension BaseDataTransaction {
|
||||
var existingObjects = [T]()
|
||||
for object in objects {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.context.existingObjectWithID(object.objectID)) as? T {
|
||||
|
||||
let existingObject = try self.context.existingObjectWithID(object.objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
@@ -101,12 +99,10 @@ public extension BaseDataTransaction {
|
||||
var existingObjects = [T]()
|
||||
for objectID in objectIDs {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.context.existingObjectWithID(objectID)) as? T {
|
||||
|
||||
let existingObject = try self.context.existingObjectWithID(objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
|
||||
@@ -81,12 +81,10 @@ public extension DataStack {
|
||||
var existingObjects = [T]()
|
||||
for object in objects {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.mainContext.existingObjectWithID(object.objectID)) as? T {
|
||||
|
||||
let existingObject = try self.mainContext.existingObjectWithID(object.objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
@@ -102,12 +100,10 @@ public extension DataStack {
|
||||
var existingObjects = [T]()
|
||||
for objectID in objectIDs {
|
||||
|
||||
do {
|
||||
if let existingObject = (try? self.mainContext.existingObjectWithID(objectID)) as? T {
|
||||
|
||||
let existingObject = try self.mainContext.existingObjectWithID(objectID) as! T
|
||||
existingObjects.append(existingObject)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
return existingObjects
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
}
|
||||
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, mapping.keys.array)) ?? [] {
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, Array(mapping.keys))) ?? [] {
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
@@ -261,7 +261,7 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
|
||||
var objects = Dictionary<T.UniqueIDType, T>()
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, mapping.keys.array)) ?? [] {
|
||||
for object in self.fetchAll(From(T), Where("%K IN %@", T.uniqueIDKeyPath, Array(mapping.keys))) ?? [] {
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ public extension DataStack {
|
||||
|
||||
let migrationOperation = NSBlockOperation()
|
||||
migrationOperation.qualityOfService = .Utility
|
||||
operations.map { migrationOperation.addDependency($0) }
|
||||
operations.forEach { migrationOperation.addDependency($0) }
|
||||
migrationOperation.addExecutionBlock { () -> Void in
|
||||
|
||||
GCDQueue.Main.async {
|
||||
|
||||
@@ -237,9 +237,9 @@ extension MigrationChain: CustomDebugStringConvertible {
|
||||
steps.append(nextVersion)
|
||||
version = nextVersion
|
||||
}
|
||||
paths.append(" → ".join(steps))
|
||||
paths.append(steps.joinWithSeparator(" → "))
|
||||
}
|
||||
|
||||
return "[" + "], [".join(paths) + "]"
|
||||
return "[" + paths.joinWithSeparator("], [") + "]"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user