We want a way to group applicants into a cohort. This can track when a group of applicants submitted their application and allow for easier re-application processes.
In the ticket, Daniel has two name ideas for this new model: UserMenteeApplicationGroup
and UserMenteeApplicationCohort
. I like the “cohort” naming personally, but I’m curious if others have any different preferences.
def change
create_table :user_mentee_application_cohorts do |t|
t.boolean :active, default: false, null: false
t.timestamps
end
add_reference :user_mentee_applications, :user_mentee_application_cohort, foreign_key: true, null: false
end
The idea here would be that when a new UserMenteeApplication
is created, it’ll be associated with the currently active cohort.
Pros
Cons
def change
create_table :user_mentee_application_cohorts do |t|
t.daterange :active_date_range, null: false
t.timestamps
end
add_reference :user_mentee_applications, :user_mentee_application_cohort, foreign_key: true, null: false
end
With this code, the date range over which the cohort accepts and processes applications will be stored. To figure out the “active” cohort that new applications should be associated with, we can look for the one whose daterange covers the current date.
Pros