tidy up (WIP: queue check for NSManagedObjectContext property updates)

This commit is contained in:
John Estropia
2016-01-08 20:44:42 +09:00
parent 762b877879
commit 3e601c1328
4 changed files with 39 additions and 25 deletions

View File

@@ -45,7 +45,7 @@ public extension BaseDataTransaction {
source: T.ImportSource) throws -> T? {
CoreStore.assert(
self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(),
self.isRunningInAllowedQueue(),
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
)
@@ -74,7 +74,7 @@ public extension BaseDataTransaction {
sourceArray: S) throws -> [T] {
CoreStore.assert(
self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(),
self.isRunningInAllowedQueue(),
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
)
@@ -109,7 +109,7 @@ public extension BaseDataTransaction {
source: T.ImportSource) throws -> T? {
CoreStore.assert(
self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(),
self.isRunningInAllowedQueue(),
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
)
@@ -160,7 +160,7 @@ public extension BaseDataTransaction {
@noescape preProcess: (mapping: [T.UniqueIDType: T.ImportSource]) throws -> [T.UniqueIDType: T.ImportSource] = { $0 }) throws -> [T] {
CoreStore.assert(
self.bypassesQueueing || self.transactionQueue.isCurrentExecutionContext(),
self.isRunningInAllowedQueue(),
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
)