|
|
|
@ -236,10 +236,16 @@ open class CustomField : RealmObject(), NameManageable, StaticRowRepresentableDa |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Remove the deleted entries from realm |
|
|
|
* Clean the entries if the type is not a list & remove the deleted entries from realm |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun cleanDeletedEntries(realm: Realm) { |
|
|
|
fun cleanEntries(realm: Realm) { |
|
|
|
realm.executeTransaction { |
|
|
|
realm.executeTransaction { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isListType) { |
|
|
|
|
|
|
|
entriesToDelete.addAll(entries) |
|
|
|
|
|
|
|
entries.clear() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
entriesToDelete.forEach { |
|
|
|
entriesToDelete.forEach { |
|
|
|
realm.where<CustomFieldEntry>().equalTo("id", it.id).findFirst()?.deleteFromRealm() |
|
|
|
realm.where<CustomFieldEntry>().equalTo("id", it.id).findFirst()?.deleteFromRealm() |
|
|
|
} |
|
|
|
} |
|
|
|
|