module EducodeSales class Activity < ApplicationRecord belongs_to :staff has_many :activity_teachers, dependent: :destroy has_many :teachers, through: :activity_teachers, dependent: :restrict_with_exception end end