0

If I have models like:

User hasMany house hasMany belongings

and I want to select all Users and the related models, but only if the user has one or more belongings--how would I set that condition? Thanks!!

pll
  • 297
  • 1
  • 5
  • 15

1 Answers1

0

use counterCache, then you can set the condition in pagination: 'belonging_count >'=> 0

Anh Pham
  • 5,431
  • 3
  • 23
  • 27