So I have a HABTM relationship between my Students and Classrooms using a join table called ClassroomStudents to handle many students belonging to many classrooms.
A recent business requirement came up that students should be able to request memberships to a classroom, so I thought that I would just create another invitation table containing classroom_id and student_id but quickly realized my classroomstudents table already handled this so I thought about simply re-using this table. I added a boolean accepted field to my classroomstudents table, true representing a membership that has been confirmed and false being the default.
There are multiple ways in which students can be added to classrooms, one of which I want them to be accepted automatically when the relationship is built. So with the following code:
@classroom << @students
How can I also specify a true value for this boolean accepted field instead of the default of false?