I have several models that I want to find so that the results can include the results of all models. Let's say I want to search for βboots,β and I want it to return the category of boots, as well as the retailers who sell the boots, as well as the actual boots. I have a model for categories, suppliers, and also products.
I would prefer not to create connection tables in this case, because each object requires joining, and this is not necessary because all objects must be included in the search.
I think about using the ransack gem, but I donβt think it is important for the question, because it would be the same regardless of my search procedure.
Maybe a complex relationship makes sense, but I can't wrap it around.
source
share