Turn Group#owners into a has_many association
What does this MR do?
This turns the regular method Group#owners
into a has_many
association.
Are there points in the code the reviewer needs to double check?
As far as I can tell there's no way to do this without using an intermediate association, but perhaps I'm missing something. The reason an intermediate association is needed is because the supplied Proc is applied to the final association (the one returning users), this means that when using a single has_many
you can't filter out any intermediate rows (e.g. group members).
Why was this MR needed?
This code being a regular method would prevent eager loading of the owners of a Group, turning it into a has_many
association resolves this problem. This was discovered in !4410 (merged).
What are the relevant issue numbers?
None.
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added -
Tests -
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together