Summary

GitHub Issue

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.

Proposals

Naming

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.

Data Modeling

Proposal 1: With Boolean Active State

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

  1. Really simple with easy querying for the active cohort

Cons

  1. Not as easy to look back at the data and understand when the cohort was actively accepting applications. It’s easy to get the currently active cohort, but not as easy to query against the cohorts that are inactive.

Proposal 2: With Active Date Range

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

  1. Easy to tell from the data when the cohort was active in the past
  2. Can distinguish all cohorts by their date range.