osem-fcy/app/models/ticket_scanning.rb
siddhantbajaj 69e30e7ba9 Improving check-in process
mark user as present for the conference when user's registration ticket for that conference is scanned
2017-09-13 22:47:22 +05:30

13 lines
299 B
Ruby

class TicketScanning < ActiveRecord::Base
belongs_to :physical_ticket
before_create :mark_user_present
private
def mark_user_present
if physical_ticket.ticket.registration_ticket?
physical_ticket.user.mark_attendance_for_conference(physical_ticket.conference)
end
end
end