2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: ticket_scannings
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
# physical_ticket_id :integer not null
|
|
|
|
|
#
|
2017-09-05 22:23:34 +03:00
|
|
|
class TicketScanning < ApplicationRecord
|
2017-07-11 17:05:07 +05:30
|
|
|
belongs_to :physical_ticket
|
2017-08-22 14:57:42 +05:30
|
|
|
|
|
|
|
|
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
|
2017-07-11 17:05:07 +05:30
|
|
|
end
|