Refactor: Introduce Group#each_member_user and Group#map_member_user
As a result of resolving cross joins on Group#users and Group#owners we have a lot of code that looks like this
group.all_owner_members.non_invite
and we need to resolve that.
We can have 3 methods in a Module included on the groups.
-
each_member_user
: It yields each member user in a block. -
map_member_user
: It maps each member user in a block. -
pluck_member_user
: It gets attributes from users that are members: See !140493 (comment 1726842661)
All these methods should accept access levels of the users. So that we can call them on owners
or any other access level instead.
See more context: !140493 (comment 1718237002)