don't warn about uncommitted changes when there aren't any

This commit is contained in:
John Rommel Estropia committed 2015-03-19 00:21:35 +09:00
1 parent bf41605da9
commit fddd42f52f
2 files changed
+3 -3

No files matched your search

@@ -152,7 +152,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.async {
self.closure(transaction: self)
if !self.isCommitted {
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
}
@@ -164,7 +164,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.sync {
self.closure(transaction: self)
if !self.isCommitted {
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
}
@@ -103,7 +103,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.sync {
self.closure(transaction: self)
if !self.isCommitted {
if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
}