class CourseMemberAttendance < ApplicationRecord # attendance_mode :1 二维码签到,2 数字签到,3 老师签到 enum attendance_mode: { QRCODE: 1, NUMBER: 2, TEACHER: 3 } # attendance_status :1 正常签到,2 请假,0 旷课 enum attendance_status: { NORMAL: 1, LEAVE: 2, ABSENCE: 3 } belongs_to :course_member belongs_to :user belongs_to :course belongs_to :course_attendance belongs_to :course_group end