@ -4,7 +4,7 @@ class StudentJoinAttendanceRecordJob < ApplicationJob
def perform(member_id)
member = CourseMember.find_by(id: member_id)
course = member&.course
return if member.blank? || course.blank?
return if member.blank? || member.role != "STUDENT" || course.blank?
current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S")
@ -165,7 +165,9 @@ class CourseMember < ApplicationRecord
private
def create_attendance_record
StudentJoinAttendanceRecordJob.perform_later(id)
if role == "STUDENT"
end