diff --git a/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt b/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt index 3cf449f..542a05e 100644 --- a/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt +++ b/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt @@ -9,16 +9,28 @@ class FruitRealmHelper : RealmHelper() { override fun insert(realmObject: Fruit) { realm.executeTransaction { - realm.copyToRealmOrUpdate(realmObject) + realm.copyToRealm(realmObject) } } override fun insert(realmObject: List) { realm.executeTransaction { + realm.copyToRealm(realmObject) + } + } + + override fun update(realmObject: Fruit) { + realm.executeTransaction { realm.copyToRealmOrUpdate(realmObject) } } + override fun update(realmObjects: List) { + realm.executeTransaction { + realm.copyToRealmOrUpdate(realmObjects) + } + } + override fun findAll(): RealmResults { return realm.where(Fruit::class.java).findAll() }