Follow-up from "Fix N+1 when loading labels on issue, epic, mrge_request lists"
The following discussion from !99117 (merged) should be addressed:
-
@DylanGriffith started a discussion: I got really confuse when looking at this scope because I thought
targets_type
was also an array and this led me to conclude that it will give incorrect results.Perhaps we can maybe just enforce it's a single string value just to be safe because I could imagine someone calling this with multiple
targets_type
in future and getting very confusing results which sometimes worked.scope :for_targets, ->(target_ids, targets_type) do raise "Only one target type allowed" unless targets_type.is_a?(String)