Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. 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. 2) populated_models = PropertyPerson.where(id: [non_populated_models])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement