app/models/student.rb
def attendance_count(semester=Semester.current)
    self
    .registree
    .section
    .events
    .map(&:rollcall)
    .compact
    .count do |rc|
      rc.present_ish?(self.id)
    end rescue false
  end
# returns false if section is nil
returns false if section is nil
returns false if section is nil
def attendance_count(semester=Semester.current)
    self
    .registree
    .section
    .events
    .map(&:rollcall)
    .compact
    .count do |rc|
      rc.present_ish?(self.id)
    end rescue false
  end
def attendance_count ( semester = Semester . current ) self . registree . section . events . map ( & :rollcall ) . compact . count do | rc | rc . present_ish? ( self . id ) end rescue false end
returns false if section is nil
returns false if section is nil
semester
current