def dependent_record_ids
      # check which dependent records are to be destroyed
      PermanentRecords.dependent_reflections(self.class)
                      .reduce({}) do |records, (key, _)|
        found = Array(send(key)).compact
        next records if found.empty?
        records.update found.first.class => found.map(&:id)
      end
    end
def dependent_record_ids
      # check which dependent records are to be destroyed
      PermanentRecords.dependent_reflections(self.class)
                      .reduce({}) do |records, (key, _)|
        found = Array(send(key)).compact
        next records if found.empty?
        records.update found.first.class => found.map(&:id)
      end
    end
return the records corresponding to an association with the `:dependent
 => :destroy` option