app/models/my_academics/class_enrollments.rb
# Groups student plans into groups based on roles (e.g. 'default', 'fpf', 'concurrent')
Groups student plans into groups based on roles
Groups student plans into groups based on roles
def grouped_student_plan_roles
      grouped_roles = {}
      current_term_cpp = get_current_and_future_cpp
      current_term_cpp.each do |term_cpp|
        term_id = term_cpp['term_id']
        career_code = term_cpp['acad_career']
        role = get_enrollment_plan_role(term_cpp)
        role_key = [role, career_code, term_id]
        grouped_roles[role_key] = { role: role, career_code: career_code, term_id: term_id, academic_plans: []} if grouped_roles[role_key].blank?
        grouped_roles[role_key][:academic_plans] << build_plan(role, term_cpp['acad_plan'])
      end
      grouped_roles
    end
def grouped_student_plan_roles grouped_roles = { } current_term_cpp = get_current_and_future_cpp current_term_cpp . each do | term_cpp | term_id = term_cpp [ 'term_id' ] career_code = term_cpp [ 'acad_career' ] role = get_enrollment_plan_role ( term_cpp ) role_key = [ role , career_code , term_id ] grouped_roles [ role_key ] = { role : role , career_code : career_code , term_id : term_id , academic_plans : [ ] } if grouped_roles [ role_key ] . blank? grouped_roles [ role_key ] [ :academic_plans ] << build_plan ( role , term_cpp [ 'acad_plan' ] ) end grouped_roles end
Groups student plans into groups based on roles (e.g.
Groups student plans into groups based on roles ( e . g .