Answer the question
In order to leave comments, you need to log in
Find few id In nested model. postgresql. Real?
On the main page there is a user filter, by the property address (nested for users).
It is performed by a method that first finds real estate within a radius of several kilometers. Then issues users to the controller. After that, user cards with real estate are rendered.
The problem is that one user can have real estate in several cities. And this filter shows an unnecessary city after rendering.
And, for example, a simple search using scope . Vida
User.includes(:real_estates).where("real_estates.address LIKE ?", search).references(:real_estates)
User.includes(:real_estates).where("real_estates.id IN (?)", (ID1 or ID2 or ID8)).references(:real_estates)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question