Count issues related merge requests based on user access level. And
issue can have related MRs from projects where user does not have
access so the number of related merge requests should be adjusted
based on user's ability to access the related MRs.
https://gitlab.com/gitlab-org/gitlab-ce/issues/59581
This method can be called with an array, or a relation:
1. Arrays always have a limited amount of values, so that's fine.
2. If the relation does not have a limit value applied, then we will load every
single object in that collection, and prevent N+1 queries for the metadata
for that. But that's wrong, because we should never call this without an
explicit limit set. So we raise in that case, and this commit will see which
specs fail.
The only failing specs here were the issues API specs, and the specs for
IssuableMetadata itself, and both have been addressed.