Scoping an association search with Ransack
问题 I have a User model with an Enrollment model associated with it. A User can have many Enrollments but each Enrollment only has one Company . My Enrollment model has a flag_contractor boolean. So if I have a User search such as :enrollment_flag_contractor false I can get inconsistant results as I am trying to scope my enrolments for the current company (via the Apartment gem). For example I have a user that has an enrollment in two separate companies, one with flag_contractor = true and one