class LunchPricePlan < ApplicationRecord
  include Base::LunchPricePlan

  associations_for legacy: true do |a|
    a.belongs_to :school

    a.has_many :users
    a.has_many :student_lunch_orders
    a.has_many :student_item_orders
  end

  has_many :students, ->(plan) { unscope(:where).where('LPPID = :id OR BPPID = :id', id: plan.id) }
end
