Is it possible to make scope in Rails with where IN (?)
query, which will check exact matches?
for example:
Post.joins(:tags).where('tags.id IN (?)', [1, 2, 3, 4])
will find posts with tags 1, 2
, 1, 2, 3
and 1, 2, 3, 4
. But should find only post with 1, 2, 3, 4
tags.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…