update tournament feature

feature/top10
Razmig Sarkissian 7 years ago
parent 9eb4884172
commit 4d75652637
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -557,10 +557,14 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre
NULL_TEXT NULL_TEXT
} }
SessionRow.TOURNAMENT_FEATURE -> tournamentFeatures?.let { SessionRow.TOURNAMENT_FEATURE -> tournamentFeatures?.let {
if (it.size > 2) {
"${it.size}"
} else {
it.joinToString {feature -> it.joinToString {feature ->
feature.name feature.name
} }
} }
}
SessionRow.TOURNAMENT_NAME -> tournamentName?.name ?: NULL_TEXT SessionRow.TOURNAMENT_NAME -> tournamentName?.name ?: NULL_TEXT
else -> throw UnmanagedRowRepresentableException("Unmanaged row = ${row.getDisplayName()}") else -> throw UnmanagedRowRepresentableException("Unmanaged row = ${row.getDisplayName()}")
} }
@ -796,6 +800,7 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre
} }
SessionRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName? SessionRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName?
SessionRow.TOURNAMENT_TYPE -> tournamentType = value as Int? SessionRow.TOURNAMENT_TYPE -> tournamentType = value as Int?
SessionRow.TOURNAMENT_FEATURE -> tournamentFeatures = value as RealmList<TournamentFeature>
} }
realm.commitTransaction() realm.commitTransaction()
} }

Loading…
Cancel
Save