mirror of
https://github.com/tappollo/WWDC.git
synced 2026-04-30 04:45:17 +08:00
Merging models when syncing from Apple's server
This commit is contained in:
@@ -64,4 +64,12 @@ public class SessionAsset: Object {
|
||||
return "remoteURL"
|
||||
}
|
||||
|
||||
func merge(with other: SessionAsset, in realm: Realm) {
|
||||
assert(other.remoteURL == self.remoteURL, "Can't merge two objects with different identifiers!")
|
||||
|
||||
self.year = other.year
|
||||
self.sessionId = other.sessionId
|
||||
self.relativeLocalURL = other.relativeLocalURL
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user