class Covid::Config < ApplicationRecord
  audited

  belongs_to :school

  before_save :disable_access, unless: :screen?

  after_save :send_notification

  private
    def disable_access
      self.parent_access = false
      self.employee_access = false
    end

    def send_notification
      Notification::ModuleConfigJob.perform_async(school_id)
    end
end
