app/controllers/sections_controller.rb
# Include grade for section as well
Include grade for section as well
Include grade for section as well
def serialize_students(student_ids, section)
    students = Student
      .active
      .where(id: student_ids)
      .includes(:student_section_assignments)
    students.map do |student|
      grade_numeric = student.student_section_assignments.find_by_section_id(section.id).grade_numeric
      student.as_json(methods: [
        :event_notes_without_restricted,
        :most_recent_school_year_discipline_incidents_count,
        :most_recent_school_year_absences_count,
        :most_recent_school_year_tardies_count
      ]).merge({
        grade_numeric: grade_numeric
      })
    end
  end
def serialize_students ( student_ids , section ) students = Student . active . where ( id : student_ids ) . includes ( :student_section_assignments ) students . map do | student | grade_numeric = student . student_section_assignments . find_by_section_id ( section . id ) . grade_numeric student . as_json ( methods : [ :event_notes_without_restricted , :most_recent_school_year_discipline_incidents_count , :most_recent_school_year_absences_count , :most_recent_school_year_tardies_count ] ) . merge ( { grade_numeric : grade_numeric } ) end end
Include grade for section as well
Include grade for section as well
student_ids
<not_specific>
section
<not_specific>