class Nursing::PrescriptionDistribution < ApplicationRecord
  include Base::Nursing::PrescriptionDistribution

  audited

  belongs_to :student, foreign_key: :StudentID, inverse_of: :nursing_prescription_distributions
  belongs_to :prescription, foreign_key: :SMSCHID, inverse_of: :distributions

  delegate :school, to: :student

  scope :by_date, ->(date) { where(date: date) if date }
end
