What I mean is this: here you are basically redoing the logic that is in the `visible` scope in Student (it's the same IF statement). So you can get rid of that `merge` and either keep the if statement here or replace it with a subquery on student ID. If you get rid of the merge, your problems with double joins should do away, so you can go back to saying `.joins{student_assignment.student.user}`