class Partner < ApplicationRecord belongs_to :school, optional: true has_many :partner_customers, dependent: :destroy has_many :customers, through: :partner_customers has_many :partner_manager_groups, dependent: :destroy has_one :admin_partner_manager_group, -> { where(admin: true) }, class_name: 'PartnerManagerGroup' has_many :partner_managers, dependent: :destroy end