Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) non_populated_models = PropertyPerson.select("property_people.id, count('items.recipient_person_id')").joins(:items).group('items.recipient_person_id, property_people.id')
- 2) populated_models = PropertyPerson.where(id: [non_populated_models])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement