This is a question that spun out of "Rails, how do I chain scopes with an "and" operator between them?".
In the accepted answer, the code example generates SQL looking something like:
"where 'age' similar to '%(foo|bar)%' AND 'name' similar to '%(foo|bar)%' AND
... and so on.
How would I implement this if I want to chain the scopes with OR
instead of AND
?