class SchoolDistrictSchool < Base::SchoolDistrictSchool
  associations_for legacy: true do |a|
    a.belongs_to :school_district, keys: :SDID
    a.belongs_to :school, inverse_of: :school_district_school
  end

  belongs_to :district_school, foreign_key: :SchoolID, inverse_of: :school_district_school,
    optional: true

  before_save :set_updated_at

  private
    def set_updated_at
      self.updated_at = Time.current
    end
end
