Say I have two relations that hold records in the same model, such as:
@companies1 = Company.where(...)
@companies2 = Company.where(...)
How can I find the intersection of these two relations, i.e. only those companies that exist within both?
Say I have two relations that hold records in the same model, such as:
@companies1 = Company.where(...)
@companies2 = Company.where(...)
How can I find the intersection of these two relations, i.e. only those companies that exist within both?