class Nursing::Complaint < ApplicationRecord
  include Base::Nursing::Complaint

  audited

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

  has_many :logs, foreign_key: :SMCID, inverse_of: :complaint, dependent: :nullify

  validates :name, presence: true, length: { maximum: 64 }

  scope :ordered, -> { order(:name) }
end
