Class: Gaku::SemesterAttendance

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/gaku/semester_attendance.rb

Class Method Summary collapse

Class Method Details

.grouped_for_tableObject



7
8
9
10
11
# File 'app/models/gaku/semester_attendance.rb', line 7

def self.grouped_for_table
  all.group_by(&:student_id).map do |k, v|
    [k, v.group_by(&:semester_id).map {|x,y| [x, y.first]}.to_h ]
  end.to_h
end