Fix preloading of project dashboard access levels
What does this MR do and why?
The #load_max_project_member_accesses
helper was preloading into the
wrong request store. This changes it to use the recently added
Preloaders::UsersMaxAccessLevelInProjectsPreloader
class that has more
advanced preloading logic.
Part of #214037
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Change the expected count to 3 in the N+1 test at
spec/features/dashboard/projects_spec.rb:255
. - Run the N+1 test; observe that it passes.
- Revert the helper method to what it was before
- Run the N+1 test; observe that it fails with the max access level being offending query
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Hordur Freyr Yngvason