1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-09-20 05:49:10 -05:00

Fix more than one current student (#311)

Fix #309
This commit is contained in:
Rafał Borcz 2019-03-28 23:07:59 +01:00 committed by Mikołaj Pich
parent c6c7357623
commit b97b94ae29
3 changed files with 7 additions and 7 deletions

View File

@ -11,10 +11,10 @@ cache:
- $HOME/.gradle/caches/ - $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/ - $HOME/.gradle/wrapper/
#branches: branches:
# only: only:
# - master - master
# - 0.7.x - 0.7.x
android: android:
licenses: licenses:

View File

@ -25,8 +25,8 @@ interface StudentDao {
@Query("SELECT * FROM Students") @Query("SELECT * FROM Students")
fun loadAll(): Maybe<List<Student>> fun loadAll(): Maybe<List<Student>>
@Query("UPDATE Students SET is_current = 1 WHERE student_id = :studentId") @Query("UPDATE Students SET is_current = 1 WHERE id = :id")
fun updateCurrent(studentId: Int) fun updateCurrent(id: Long)
@Query("UPDATE Students SET is_current = 0") @Query("UPDATE Students SET is_current = 0")
fun resetCurrent() fun resetCurrent()

View File

@ -35,7 +35,7 @@ class StudentLocal @Inject constructor(
return Completable.fromCallable { return Completable.fromCallable {
studentDb.run { studentDb.run {
resetCurrent() resetCurrent()
updateCurrent(student.studentId) updateCurrent(student.id)
} }
} }
} }