Skip to content

Commit 5556d10

Browse files
committed
Fix last_activity_id issue from cc09017
1 parent f8d5b0f commit 5556d10

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

app/sprinkles/account/src/Database/Models/User.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ public function delete($hardDelete = false)
188188
// Remove all role associations
189189
$this->roles()->detach();
190190

191+
// Remove last activity association
192+
$this->lastActivity()->dissociate();
193+
$this->save();
194+
191195
// Remove all user tokens
192196
$this->activities()->delete();
193197
$this->passwordResets()->delete();

app/sprinkles/account/src/Log/UserActivityDatabaseHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function write(array $record)
2828

2929
if (isset($record['extra']['user_id'])) {
3030
$user = $this->classMapper->staticMethod('user', 'find', $record['extra']['user_id']);
31-
$user->last_activity_id = $log->id;
31+
$user->lastActivity()->associate($log);
3232
$user->save();
3333
}
3434
}

0 commit comments

Comments
 (0)