RowModel.setDirty()

This commit is contained in:
Gwendal Roué committed 2015-07-10 09:09:54 +02:00
1 parent 82141f7701
commit a3a0fa39f7
1 file changed
+11 -6
+11 -6
View File
@@ -113,11 +113,11 @@ public class RowModel {
}
// Primary key may have been updated: set dirty.
cleanRow = nil
setDirty()
}
/// MARK: - Dirty
// MARK: - Dirty
/// Return false if the stored database dictionary is known to be not been
/// modified since last synchronization with the database (save or reload).
@@ -130,7 +130,15 @@ public class RowModel {
return cleanRow.containsSameColumnsAndValuesAsRow(Row(dictionary: storedDatabaseDictionary))
}
/// Forces the dirty flag
public func setDirty() {
cleanRow = nil
}
/// Reference row for isDirty.
private var cleanRow: Row?
// MARK: - CRUD
/// An enum that specifies an alternative constraint conflict resolution
@@ -195,7 +203,7 @@ public class RowModel {
// Future calls to update and save MUST throw RowModelNotFound.
// A way to achieve this is to set rowModel dirty.
cleanRow = nil
setDirty()
}
/// Throws an error if the model has no table name, or no primary key.
@@ -213,9 +221,6 @@ public class RowModel {
}
}
/// Reference row for isDirty.
private var cleanRow: Row?
// MARK: - Version