'Fixed' merging errors
This commit is contained in:
parent
c6c8f7b12e
commit
56164f2ce4
|
@ -4,18 +4,17 @@ import BankingUiSwift
|
||||||
|
|
||||||
|
|
||||||
class CoreDataBankingPersistence: IBankingPersistence, IRemitteeSearcher {
|
class CoreDataBankingPersistence: IBankingPersistence, IRemitteeSearcher {
|
||||||
|
|
||||||
private let persistentContainer: NSPersistentContainer
|
|
||||||
|
|
||||||
private let mapper = Mapper()
|
private let mapper = Mapper()
|
||||||
|
|
||||||
private var context: NSManagedObjectContext {
|
private let context: NSManagedObjectContext
|
||||||
return persistentContainer.viewContext
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
init(persistentContainer: NSPersistentContainer) {
|
init(context: NSManagedObjectContext) {
|
||||||
self.persistentContainer = persistentContainer
|
self.context = context
|
||||||
|
|
||||||
|
// to fix merging / updating cached objects, see Mapper
|
||||||
|
context.mergePolicy = NSMergePolicy(merge: NSMergePolicyType.mergeByPropertyObjectTrumpMergePolicyType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue