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