class EmployeeDetail < ApplicationRecord
  include Base::EmployeeDetail

  enum ethnicity: { unspecified: 0, non_hispanic: 1, hispanic: 2 }

  audited associated_with: :employee

  audited

  enum ncea_status: { no_status: 0, full_time: 1, part_time: 2 }

  belongs_to :employee, foreign_key: :UserID, inverse_of: :detail
  belongs_to :author, class_name: 'Employee', foreign_key: :AuthorID,
    inverse_of: :authored_employee_details

  before_save :set_updated_at

  private
    def set_updated_at
      self.updated_at = Time.zone.now
    end
end
