app/controllers/home_controller.rb
# The feed of everything going on with all students the educator has access
# to view.
The feed of everything going on with all students the educator has access
to view.
The feed of everything going on with all students the educator has access to view .
def students_with_high_absences_json
    educator = current_educator_or_doppleganger(params[:educator_id])
    time_now = time_now_or_param(params[:time_now])
    limit = params[:limit].to_i
    time_threshold = InsightStudentsWithHighAbsences.time_threshold_capped_to_school_year(time_now, 45.days)
    absences_threshold = 4
    insight = InsightStudentsWithHighAbsences.new(educator)
    students_with_high_absences_json = insight.students_with_high_absences_json(time_now, time_threshold, absences_threshold)
    render json: {
      limit: limit,
      total_students: students_with_high_absences_json.size,
      students_with_high_absences: students_with_high_absences_json.first(limit)
    }
  end
def students_with_high_absences_json educator = current_educator_or_doppleganger ( params [ :educator_id ] ) time_now = time_now_or_param ( params [ :time_now ] ) limit = params [ :limit ] . to_i time_threshold = InsightStudentsWithHighAbsences . time_threshold_capped_to_school_year ( time_now , 45 . days ) absences_threshold = 4 insight = InsightStudentsWithHighAbsences . new ( educator ) students_with_high_absences_json = insight . students_with_high_absences_json ( time_now , time_threshold , absences_threshold ) render json : { limit : limit , total_students : students_with_high_absences_json . size , students_with_high_absences : students_with_high_absences_json . first ( limit ) } end
The feed of everything going on with all students the educator has access
to view.
The feed of everything going on with all students the educator has access to view .