Skip to content

Set operators can receive array or multiple parameters

What does this MR do and why?

Our set operator concerns from_union, from_intersect, from_except take an array parameter of ActiveRecord::Relation objects. This MR allows us to splat the array parameter in to multiple parameters. In some cases this can improve readability of code.

Before:

from_union([Group.where(id: 1), Group.where(id: 2), Group.where(id: 3)])

After:

from_union(Group.where(id: 1), Group.where(id: 2), Group.where(id: 3))

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #244294 (closed)

Edited by Alex Pooley

Merge request reports