Fix user specs for Rails 7
What does this MR do and why?
In Rails 7, the #size
call was triggering an invalid count query because of the distinct
call so we force the relation to be loaded.
This is extracted from the Rails 7 MR to make it smaller. The change also works in Rails 6 so we can merge it ahead to master.
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 Heinrich Lee Yu