Skip to content

Commit

Permalink
Fixed appetite tracking upgrade. Bump to 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe Anderson committed Aug 5, 2018
1 parent ebdc2b0 commit 606e095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.log28"
minSdkVersion 15
targetSdkVersion 27
versionCode 10
versionName "0.6.0"
versionCode 11
versionName "0.6.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/com/log28/Database.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,20 @@ fun initializeRealm(context: Context) {
fun insertAppetite(context: Context) {
Log.d(TAG, "Insert appetite called")
val realm = Realm.getDefaultInstance()
val appetite = context.resources.getStringArray(R.array.categories).get(4)
val appetite = context.resources.getStringArray(R.array.categories)[4]
val appetiteSymptoms = context.resources.getStringArray(R.array.appetite)

realm.executeTransactionAsync {
localRealm ->
val appetiteCategory = Category(appetite, true)
localRealm.copyToRealm(appetiteCategory)
var appetiteCategory = Category(appetite, true)
appetiteCategory = localRealm.copyToRealm(appetiteCategory)

appetiteSymptoms.forEach {
val symptom = Symptom(it, appetiteCategory, true)
localRealm.copyToRealm(symptom)
}
}
realm.close()
}

fun exportDBToLocation(location: File): String {
Expand Down

0 comments on commit 606e095

Please sign in to comment.