Create query object for users by intent and add a model method to Draw
The following discussion from !916 (merged) should be addressed:
-
@orenyk started a discussion: I feel like we should add a Draw method for
on_campus_students
and/or a query object for that status (i.e.@relation.joins(:draw_memberships).where(draw_membership: { intent: %w(on_campus) })
) - this is way harder to read than@draw.students.on_campus
. -
@orenyk started a discussion: Another intent-based query for students in a draw. This should have originally been
draw.students.undeclared
, probably, and I think we can end up with aDraw#students_with_intent(%w(undeclared))
method that makes this much easier to read. It can either take an array of intents or optionally handle either an array or an individual intent string.