Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove N+1 on register attendance page
The `.select` was causing a query for `session_attendances` based on today's `@session_date`. Instead, we can more directly use two `where` clauses: - Either for patient sessions with no attendances - Or for patient sessions with attendances but not on today's date The patient sessions need to be stored in an intermediate `ps` variable to maintain the joins from `includes` when using `.or`.
- Loading branch information